Wow, first of all i’ve got to say i’ve never seen a community as active and helpful as this one before! Thank you so much!
Ive tried to recreate you solution:
create a new shader file glsl / hlsl:
void VS()
{
mat4 modelMatrix = iModelMatrix;
vec3 worldPos = GetWorldPos(modelMatrix);
gl_Position = GetClipPos(worldPos);
vNormal = GetWorldNormal(modelMatrix);
vWorldPos = vec4(worldPos, GetDepth(gl_Position));
vec3 n = cCameraPos - worldPos;
if (dot(n, vNormal) < 0.0)
{
vNormal *= -1.0;
}
...
float4x3 modelMatrix = iModelMatrix;
float3 worldPos = GetWorldPos(modelMatrix);
oPos = GetClipPos(worldPos);
oNormal = GetWorldNormal(modelMatrix);
oWorldPos = float4(worldPos, GetDepth(oPos));
float3 n = cCameraPos - worldPos;
if (dot(n, oNormal) < 0.0)
{
oNormal *= -1.0;
}
save it as flippedNormal.hlsl/glsl
Edit my material:
<material>
<technique name="Techniques/FlippedNormalTechnique.xml" />
<parameter name="MatDiffColor" value="0.6 0.6 0.6 1" />
<parameter name="MatSpecColor" value="0 0 0 0" />
<parameter name="MatEmissiveColor" value="0 0 0 1" />
<cull value="none" />
<shadowcull value="none" />
</material>
Then edit my technique to include the edited shader
<technique vs="flippedNormal" ps="flippedNormal" psdefines="DIFFMAP">
<pass name="base" />
<pass name="litbase" psdefines="AMBIENT" />
<pass name="light" depthtest="equal" depthwrite="false" blend="add" />
<pass name="prepass" psdefines="PREPASS" />
<pass name="material" psdefines="MATERIAL" depthtest="equal" depthwrite="false" />
<pass name="deferred" psdefines="DEFERRED" />
<pass name="depth" vs="Depth" ps="Depth" />
<pass name="shadow" vs="Shadow" ps="Shadow" />
</technique>
Sadly this isnt working for me yet. Could you upload your material/technique/shader? Sorry I’m new to all this shader stuff