Skip to content
Snippets Groups Projects
Commit d815bb67 authored by Eric Wait's avatar Eric Wait
Browse files

Adjusted the alpha in the pixel shader

parent 07944a71
Branches
No related tags found
1 merge request!1Split Hull Bug Fix
......@@ -308,7 +308,7 @@ void createStaticVolumeShaderText(std::string strChans)
shaderText += "\t\tfloat intensity = g_txDiffuse[i].Sample( g_samLinear[i], input.TextureUV );\n";
shaderText += "\t\tintensity = clamp(intensity,ranges[i][0],ranges[i][1]);\n";
shaderText += "\t\tintensity = transferFunctions[i][0]*intensity*intensity+transferFunctions[i][1]*intensity+transferFunctions[i][2];\n";
shaderText += "\t\tif (intensity < 0.2f || channelColor[i].a < 0.2f)\n";
shaderText += "\t\tif (intensity < 0.2f || channelColor[i].a < 0.01f)\n";
shaderText += "\t\t{\n";
shaderText += "\t\t\tintensity = 0;\n";
shaderText += "\t\t}\n";
......@@ -334,14 +334,19 @@ void createStaticVolumeShaderText(std::string strChans)
shaderText += "\t}\n";
shaderText += "\n";
shaderText += "\tfloat maxComponent = max(max(unlitComposite.r,unlitComposite.g),unlitComposite.b);\n";
shaderText += "\tfloat maxAplha = max(max(alphaComposite.r,alphaComposite.g),alphaComposite.b);\n";
shaderText += "\tif (maxComponent!=0)\n";
shaderText += "\t{\n";
shaderText += "\t\toutput.color.rgb /= maxComponent;\n";
shaderText += "\t\toutput.color.rgb *= maxIntensity;\n";
shaderText += "\t}\n";
shaderText += "\tif (maxAplha!=0)\n";
shaderText += "\t{\n";
shaderText += "\t\toutput.color.a = maxAplha;\n";
shaderText += "\t}else{\n";
shaderText += "\t\toutput.color.a = 0;\n";
shaderText += "\t}\n";
shaderText += "\n";
//shaderText += "\toutput.color.a = maxIntensity;\n";
shaderText += "\toutput.color.a = max(max(alphaComposite.r,alphaComposite.g),alphaComposite.b);\n";
shaderText += "\n";
shaderText += "\tif(lightOn.y>0)\n";
shaderText += "\t{\n";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment