Commit 07623160 authored by Alexander Wiebel's avatar Alexander Wiebel

[ADD] forgot this change

parent febc633d
varying vec4 VaryingTexCoord0;
varying vec4 VaryingTexCoord1;
varying vec4 VaryingTexCoord2;
varying vec4 VaryingTexCoord3;
varying vec4 VaryingTexCoord4;
varying vec4 VaryingTexCoord5;
varying vec4 VaryingTexCoord6;
varying vec4 VaryingTexCoord7;
varying vec4 VaryingTexCoord8;
varying vec4 VaryingTexCoord9;
uniform bool useLighting;
uniform bool useTexture;
......@@ -49,25 +58,37 @@ uniform float alpha7;
uniform float alpha8;
uniform float alpha9;
uniform int useCmap0;
uniform int useCmap1;
uniform int useCmap2;
uniform int useCmap3;
uniform int useCmap4;
uniform int useCmap5;
uniform int useCmap6;
uniform int useCmap7;
uniform int useCmap8;
uniform int useCmap9;
#include "colorMaps.fs"
#include "lighting.fs"
void lookupTex(inout vec4 col, in int type, in sampler3D tex, in float threshold, in vec3 v, in float alpha)
void lookupTex(inout vec4 col, in int type, in sampler3D tex, in float threshold, in vec3 v, in float alpha, in int cmap)
{
vec3 col1 = vec3(0.0);
col1 = clamp( texture3D(tex, v).rgb, 0.0, 1.0);
if ( ( col1.r + col1.g + col1.b ) / 3.0 - threshold <= 0.0) return;
if( ( col1.r + col1.g + col1.b ) / 3.0 - threshold <= 0.0) return;
if ( type == 16 && useColorMap != -1)
if( cmap != 0 )
{
if (threshold < 1.0)
{
col1.r = (col1.r - threshold) / (1.0 - threshold);
}
colorMap(col1, col1.r, useColorMap );
colorMap(col1, col1.r, cmap );
}
col.rgb = mix( col.rgb, col1.rgb, alpha);
......@@ -86,16 +107,16 @@ void main()
if( useTexture )
{
if ( type9 > 0 ) lookupTex(col, type9, tex9, threshold9, VaryingTexCoord0.xyz, alpha9);
if ( type8 > 0 ) lookupTex(col, type8, tex8, threshold8, VaryingTexCoord0.xyz, alpha8);
if ( type7 > 0 ) lookupTex(col, type7, tex7, threshold7, VaryingTexCoord0.xyz, alpha7);
if ( type6 > 0 ) lookupTex(col, type6, tex6, threshold6, VaryingTexCoord0.xyz, alpha6);
if ( type5 > 0 ) lookupTex(col, type5, tex5, threshold5, VaryingTexCoord0.xyz, alpha5);
if ( type4 > 0 ) lookupTex(col, type4, tex4, threshold4, VaryingTexCoord0.xyz, alpha4);
if ( type3 > 0 ) lookupTex(col, type3, tex3, threshold3, VaryingTexCoord0.xyz, alpha3);
if ( type2 > 0 ) lookupTex(col, type2, tex2, threshold2, VaryingTexCoord0.xyz, alpha2);
if ( type1 > 0 ) lookupTex(col, type1, tex1, threshold1, VaryingTexCoord0.xyz, alpha1);
if ( type0 > 0 ) lookupTex(col, type0, tex0, threshold0, VaryingTexCoord0.xyz, alpha0);
if ( type9 > 0 ) lookupTex(col, type9, tex9, threshold9, VaryingTexCoord9.xyz, alpha9, useCmap9);
if ( type8 > 0 ) lookupTex(col, type8, tex8, threshold8, VaryingTexCoord8.xyz, alpha8, useCmap8);
if ( type7 > 0 ) lookupTex(col, type7, tex7, threshold7, VaryingTexCoord7.xyz, alpha7, useCmap7);
if ( type6 > 0 ) lookupTex(col, type6, tex6, threshold6, VaryingTexCoord6.xyz, alpha6, useCmap6);
if ( type5 > 0 ) lookupTex(col, type5, tex5, threshold5, VaryingTexCoord5.xyz, alpha5, useCmap5);
if ( type4 > 0 ) lookupTex(col, type4, tex4, threshold4, VaryingTexCoord4.xyz, alpha4, useCmap4);
if ( type3 > 0 ) lookupTex(col, type3, tex3, threshold3, VaryingTexCoord3.xyz, alpha3, useCmap3);
if ( type2 > 0 ) lookupTex(col, type2, tex2, threshold2, VaryingTexCoord2.xyz, alpha2, useCmap2);
if ( type1 > 0 ) lookupTex(col, type1, tex1, threshold1, VaryingTexCoord1.xyz, alpha1, useCmap1);
if ( type0 > 0 ) lookupTex(col, type0, tex0, threshold0, VaryingTexCoord0.xyz, alpha0, useCmap0);
}
if ( useLighting )
col = col + (ambient * col / 2.0) + (diffuse * col) + (specular * col / 2.0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment