In stable i got error:
on02:06:02: OGRE EXCEPTION(2:InvalidParametersException): Parameter called texSize does not exist. in GpuProgramParameters::_findNamedConstantDefinition at src\OgreGpuProgramParams.cpp (line 1719)
02:06:02: Compiler error: invalid parameters in ConeStepMapping.program(21): setting of constant failed
Code: Select all
param_named_auto texSize texture_size 0
Shader fragment:
Code: Select all
POut csm_ps(PIn IN,
uniform float4 texSize,
uniform float depth, // depth scale of the surface
uniform sampler2D diffuseMap : TEXUNIT0,
uniform sampler2D csmMap : TEXUNIT1)
{
POut OUT;
float a = -depth / IN.tsPos.z;
float3 s = float3((IN.tsPos * a).xy, 1);
// texture-delta-based LOD
float df = 0.05 * sqrt(length(fwidth(IN.uv)));
float3 uv = float3(IN.uv, 0);
intersect_square_cone_exp(csmMap, uv, s, df);
// expand normal from normal map in local polygon space
// blue = df/dx
// alpha = df/dy
// not used in this little port
// (you'd use this for NdotL with the tangent-space light direction)
float4 normal = tex2D(csmMap, uv.xy);
normal = float4((normal.ba - 0.5) * (-depth * texSize.xy), 1.0, 0.0);
normal.xyz = normalize(normal.xyz);
float4 diffuse = tex2D(diffuseMap, uv.xy);
OUT.colour = diffuse;
return OUT;
}