diff --git a/neo/renderer/RenderProgs_embedded.h b/neo/renderer/RenderProgs_embedded.h index 05b3c809..3c86c68b 100644 --- a/neo/renderer/RenderProgs_embedded.h +++ b/neo/renderer/RenderProgs_embedded.h @@ -2364,8 +2364,8 @@ static const cgShaderDef_t cg_renderprogs[] = "float2 tapLocation( int sampleNumber, float spinAngle, out float ssR )\n" "{\n" " // Radius relative to ssR\n" - " float alpha = float( sampleNumber + 0.5 ) * ( 1.0 / NUM_SAMPLES );\n" - " float angle = alpha * ( NUM_SPIRAL_TURNS * 6.28 ) + spinAngle;\n" + " float alpha = ( float( sampleNumber ) + 0.5 ) * ( 1.0 / float( NUM_SAMPLES ) );\n" + " float angle = alpha * ( float( NUM_SPIRAL_TURNS ) * 6.28 ) + spinAngle;\n" " \n" " ssR = alpha;\n" " return float2( cos( angle ), sin( angle ) );\n" @@ -2563,7 +2563,7 @@ static const cgShaderDef_t cg_renderprogs[] = "#else\n" " // Reconstruct normals from positions.\n" " float3 n_C = reconstructNonUnitCSFaceNormal( C );\n" - " // Since n_C is computed from the cross product of cmaera-space edge vectors from points at adjacent pixels, its magnitude will be proportional to the square of distance from the camera\n" + " // Since n_C is computed from the cross product of camera-space edge vectors from points at adjacent pixels, its magnitude will be proportional to the square of distance from the camera\n" " if( dot( n_C, n_C ) > ( square( C.z * C.z * 0.00006 ) ) ) // if the threshold # is too big you will see black dots where we used a bad normal at edges, too small -> white\n" " {\n" " // The normals from depth should be very small values before normalization,\n" @@ -2580,12 +2580,12 @@ static const cgShaderDef_t cg_renderprogs[] = "#endif\n" " \n" " // Hash function used in the HPG12 AlchemyAO paper\n" - " float randomPatternRotationAngle = ( ( ( 3 * ssP.x ) ^ ( ssP.y + ssP.x * ssP.y ) )\n" + " float randomPatternRotationAngle = float( ( ( 3 * ssP.x ) ^ ( ssP.y + ssP.x * ssP.y ) )\n" "#if TEMPORALLY_VARY_TAPS\n" - " + rpJitterTexOffset.x\n" + " + rpJitterTexOffset.x\n" "#endif\n" - " ) * 10;\n" - " \n" + " ) * 10.0;\n" + " \n" " // Choose the screen-space sample radius\n" " // proportional to the projected area of the sphere\n" " float ssDiskRadius = -projScale * radius / C.z;\n" @@ -2608,13 +2608,13 @@ static const cgShaderDef_t cg_renderprogs[] = " float sum = 0.0;\n" " for( int i = 0; i < NUM_SAMPLES; ++i )\n" " {\n" - " sum += sampleAO( ssP, C, n_C, ssDiskRadius, i, randomPatternRotationAngle, CS_Z_buffer, 1 );\n" + " sum += sampleAO( ssP, C, n_C, ssDiskRadius, i, randomPatternRotationAngle, CS_Z_buffer, 1.0 );\n" " }\n" " \n" "#if HIGH_QUALITY\n" - " float A = pow( max( 0.0, 1.0 - sqrt( sum * ( 3.0 / NUM_SAMPLES ) ) ), intensity );\n" + " float A = pow( max( 0.0, 1.0 - sqrt( sum * ( 3.0 / float( NUM_SAMPLES ) ) ) ), intensity );\n" "#else\n" - " float A = max( 0.0, 1.0 - sum * intensityDivR6 * ( 5.0 / NUM_SAMPLES ) );\n" + " float A = max( 0.0, 1.0 - sum * intensityDivR6 * ( 5.0 / float( NUM_SAMPLES ) ) );\n" " // Anti-tone map to reduce contrast and drag dark region farther\n" " // (x^0.2 + 1.2 * x^4)/2.2\n" " //A = ( pow( A, 0.2 ) + 1.2 * A * A * A * A ) / 2.2;\n" @@ -5035,8 +5035,8 @@ static const cgShaderDef_t cg_renderprogs[] = "float2 tapLocation( int sampleNumber, float spinAngle, float radialJitter, out float ssR )\n" "{\n" " // Radius relative to ssR\n" - " float alpha = float( sampleNumber + radialJitter ) * ( 1.0 / NUM_SAMPLES );\n" - " float angle = alpha * ( NUM_SPIRAL_TURNS * 6.28 ) + spinAngle;\n" + " float alpha = ( float( sampleNumber ) + radialJitter) * ( 1.0 / float( NUM_SAMPLES ) );\n" + " float angle = alpha * ( float( NUM_SPIRAL_TURNS ) * 6.28 ) + spinAngle;\n" " \n" " ssR = alpha;\n" " return float2( cos( angle ), sin( angle ) );\n" @@ -5222,7 +5222,7 @@ static const cgShaderDef_t cg_renderprogs[] = " // E = radiosity_Y * dot(w_i, n_X) * weight_Y * float(dot(YminusX, YminusX) < radius2);\n" " \n" " if( ( dot( YminusX, YminusX ) < radius2 ) && // Radius check\n" - " ( weight_Y > 0 ) )\n" + " ( weight_Y > 0.0 ) )\n" " {\n" " E = radiosity_Y * dot( w_i, n_X );\n" " }\n" @@ -5352,7 +5352,7 @@ static const cgShaderDef_t cg_renderprogs[] = " float ssDiskRadius = -projScale * radius / C.z;\n" " \n" " // Hash function used in the HPG12 AlchemyAO paper\n" - " float randomPatternRotationAngle = ( 3 * ssC.x ^ ssC.y + ssC.x * ssC.y ) * 10;\n" + " float randomPatternRotationAngle = float( 3 * ssC.x ^ ssC.y + ssC.x * ssC.y ) * 10.0;\n" "#if TEMPORALLY_VARY_TAPS\n" " randomPatternRotationAngle += rpJitterTexOffset.x;\n" "#endif\n" @@ -5372,23 +5372,23 @@ static const cgShaderDef_t cg_renderprogs[] = " sampleIndirectLight( ssC, C, n_C, C_peeled, n_C_peeled, ssDiskRadius, i, randomPatternRotationAngle, radialJitter, CS_Z_buffer, normal_buffer, colorBuffer, irradianceSum, numSamplesUsed, ii_peeled, peeledSum );\n" " }\n" " \n" - " const float solidAngleHemisphere = 2 * PI;\n" + " const float solidAngleHemisphere = 2.0 * PI;\n" " float3 E_X = irradianceSum * solidAngleHemisphere / ( numSamplesUsed + 0.00001 );\n" " \n" " indirectColor = E_X;\n" " //indirectColor = pow( E_X, float3( 1.0 / 2.2 ) ); // RB: to sRGB\n" " \n" " // What is the ambient visibility of this location\n" - " visibility = 1 - numSamplesUsed / float( NUM_SAMPLES );\n" + " visibility = 1.0 - numSamplesUsed / float( NUM_SAMPLES );\n" " //visibility = clamp( 1 - numSamplesUsed / float( NUM_SAMPLES ), 0.0, 1.0 );\n" - " //visibility = pow( max( 0.0, 1.0 - sqrt( sum * ( 3.0 / NUM_SAMPLES ) ) ), intensity );\n" + " //visibility = pow( max( 0.0, 1.0 - sqrt( sum * ( 3.0 / float( NUM_SAMPLES ) ) ) ), intensity );\n" " \n" " //result.color = float4( visibility, visibility, visibility, 1.0 );\n" " //result.color = float4( n_C * 0.5 + 0.5, 1.0 );\n" " //result.color = texture( samp2, fragment.texcoord0 ).rgba;\n" " \n" "#if COMPUTE_PEELED_LAYER\n" - " float A_peeled = 1 - peeledSum / float( NUM_SAMPLES );\n" + " float A_peeled = 1.0 - peeledSum / float( NUM_SAMPLES );\n" " float3 E_X_peeled = ii_peeled * solidAngleHemisphere / ( peeledSum + 0.00001 );\n" " \n" " indirectPeeledResult = E_X_peeled;\n"