Skip to content

Commit

Permalink
RTSS: merge FFPLib_Transform.{cg, hlsl}
Browse files Browse the repository at this point in the history
  • Loading branch information
paroj committed Jan 18, 2022
1 parent badd666 commit 5f20436
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 89 deletions.
27 changes: 23 additions & 4 deletions Media/RTShaderLib/GLSL/FFPLib_Transform.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,41 @@ void FFP_Transform(in mat3 m,
in vec3 v,
out vec3 vOut)
{
vOut = m * v;
vOut = mul(m, v);
}

//-----------------------------------------------------------------------------
void FFP_Transform(in mat4 m,
in vec4 v,
out vec4 vOut)
{
vOut = m * v;
vOut = mul(m, v);
}

//-----------------------------------------------------------------------------
void FFP_Transform(in mat4 m,
in vec4 v,
out vec3 vOut)
{
vOut = (m * v).xyz;
vOut = mul(m, v).xyz;
}

#ifdef OGRE_HLSL
void FFP_Transform(in float3x4 m,
in float4 v,
out float3 vOut)
{
vOut = mul(m, v);
}

#if !defined(OGRE_GLSLES) || OGRE_GLSLES > 100
//-----------------------------------------------------------------------------
void FFP_Transform(in float3x4 m,
in float3 v,
out float3 vOut)
{
vOut = mul((float3x3)m, v);
}
#elif !defined(OGRE_GLSLES) || OGRE_GLSLES > 100
//-----------------------------------------------------------------------------
void FFP_Transform(in mat3x4 m,
in vec4 v,
Expand All @@ -86,7 +101,11 @@ void FFP_Transform(in mat4 m,
in vec3 v,
out vec3 vOut)
{
#ifdef OGRE_HLSL
vOut = mul((float3x3)m, v);
#else
vOut = mat3(m) * v;
#endif
}

//-----------------------------------------------------------------------------
Expand Down
85 changes: 0 additions & 85 deletions Media/RTShaderLib/HLSL_Cg/FFPLib_Transform.cg

This file was deleted.

0 comments on commit 5f20436

Please sign in to comment.