Changeset View
Changeset View
Standalone View
Standalone View
source/blender/gpu/shaders/gpu_shader_material.glsl
| Show First 20 Lines • Show All 1,006 Lines • ▼ Show 20 Lines | |||||
| void mtex_rgb_color(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 incol) | void mtex_rgb_color(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 incol) | ||||
| { | { | ||||
| vec4 col; | vec4 col; | ||||
| mix_color(fact*facg, vec4(outcol, 1.0), vec4(texcol, 1.0), col); | mix_color(fact*facg, vec4(outcol, 1.0), vec4(texcol, 1.0), col); | ||||
| incol.rgb = col.rgb; | incol.rgb = col.rgb; | ||||
| } | } | ||||
| void mtex_rgb_soft(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 incol) | |||||
| { | |||||
| float facm, col; | |||||
| fact *= facg; | |||||
| facm = 1.0-fact; | |||||
| vec3 one= vec3(1.0); | |||||
psy-fi: spacing here and below in assignment | |||||
| vec3 scr= one - (one - texcol)*(one - outcol); | |||||
| incol = facm*outcol + fact*((one - texcol)*outcol*texcol + outcol*scr); | |||||
| } | |||||
| void mtex_rgb_linear(vec3 outcol, vec3 texcol, float fact, float facg, out vec3 incol) | |||||
| { | |||||
| fact *= facg; | |||||
| if(texcol.r > 0.5) | |||||
psy-fiUnsubmitted Not Done Inline Actionsspacing in all assignments in this function psy-fi: spacing in all assignments in this function | |||||
| incol.r= outcol.r + fact*(2.0*(texcol.r - 0.5)); | |||||
| else | |||||
| incol.r= outcol.r + fact*(2.0*(texcol.r) - 1.0); | |||||
| if(texcol.g > 0.5) | |||||
| incol.g= outcol.g + fact*(2.0*(texcol.g - 0.5)); | |||||
| else | |||||
| incol.g= outcol.g + fact*(2.0*(texcol.g) - 1.0); | |||||
| if(texcol.b > 0.5) | |||||
| incol.b= outcol.b + fact*(2.0*(texcol.b - 0.5)); | |||||
| else | |||||
| incol.b= outcol.b + fact*(2.0*(texcol.b) - 1.0); | |||||
| } | |||||
| void mtex_value_vars(inout float fact, float facg, out float facm) | void mtex_value_vars(inout float fact, float facg, out float facm) | ||||
| { | { | ||||
| fact *= abs(facg); | fact *= abs(facg); | ||||
| facm = 1.0-fact; | facm = 1.0-fact; | ||||
| if(facg < 0.0) { | if(facg < 0.0) { | ||||
| float tmp = fact; | float tmp = fact; | ||||
| fact = facm; | fact = facm; | ||||
| ▲ Show 20 Lines • Show All 1,438 Lines • Show Last 20 Lines | |||||
spacing here and below in assignment