mode | Texture shading mode |
The modes that can be set are listed below.
NJD_TEX_SHADING_MODE_DECAL | Adds the offset value to the texture color |
NJD_TEX_SHADING_MODE_MODULATE | Mixes the color that is the result of shading with the texture color |
NJD_TEX_SHADING_MODE_DECALALPHA | Blends the texture color and the shading color |
NJD_TEX_SHADING_MODE_MODULATEALPHA | Mixes the shading color with the texture color (default) |
This function is to specify the combination method of shading color (base COLor, OFFSETcolor, alpha) which was interpolated between vertex and texture color. The calculation is as follows.
Decal | PIXrgb = TEXrgb + OFFSETrgb , PIXa = TEXa |
Modulate | PIXrgb = COLrgb * TEXrgb + OFFSETrgb , PIXa = COLa |
DecalAlpha | PIXrgb = (TEXrgb * TEXa) + (COLrgb * (1-TEXa)) + OFFSETrgb , PIXa = COLa |
ModulateAlpha | PIXrgb = COLrgb * TEXrgb + OFFSETrgb , PIXa = COLa * TEXa |
njTextureShadingMode(NJD_TEX_SHADING_MODE_DECAL); njCnkDrawObject(OBJ1); njTextureShadingMode(NJD_TEX_SHADING_MODE_MODULATE); njCnkDrawObject(OBJ2);