Skip to content

Commit

Permalink
shaders: Normalize position in skinning structs.
Browse files Browse the repository at this point in the history
  • Loading branch information
CrossVR committed Mar 22, 2016
1 parent f3b036b commit 59a054e
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 29 deletions.
4 changes: 0 additions & 4 deletions res/gamedata/shaders/gl/iostructs/v_model_bump.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@

out gl_PerVertex { vec4 gl_Position; };

#ifdef SKIN_NONE
layout(location = POSITION) in float4 v_model_P ; // POSITION; // (float,float,float,1)
#else
layout(location = POSITION) in int4 v_model_P ; // POSITION; // (float,float,float,1) - quantized
#endif
#ifdef SKIN_0
layout(location = NORMAL) in float3 v_model_N ; // NORMAL; // (nx,ny,nz)
#else
Expand Down
4 changes: 0 additions & 4 deletions res/gamedata/shaders/gl/iostructs/v_model_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@ struct v2p
float4 hpos ; // SV_Position;
};

#ifdef SKIN_NONE
layout(location = POSITION) in float4 v_model_P ; // POSITION; // (float,float,float,1)
#else
layout(location = POSITION) in int4 v_model_P ; // POSITION; // (float,float,float,1) - quantized
#endif
#ifdef SKIN_0
layout(location = NORMAL) in float3 v_model_N ; // NORMAL; // (nx,ny,nz)
#else
Expand Down
4 changes: 0 additions & 4 deletions res/gamedata/shaders/gl/iostructs/v_model_distort.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ struct vf
float4 hpos; // SV_Position;
};

#ifdef SKIN_NONE
layout(location = POSITION) in float4 v_model_P ; // POSITION; // (float,float,float,1)
#else
layout(location = POSITION) in int4 v_model_P ; // POSITION; // (float,float,float,1) - quantized
#endif
#ifdef SKIN_0
layout(location = NORMAL) in float3 v_model_N ; // NORMAL; // (nx,ny,nz)
#else
Expand Down
4 changes: 0 additions & 4 deletions res/gamedata/shaders/gl/iostructs/v_model_flat.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@

out gl_PerVertex { vec4 gl_Position; };

#ifdef SKIN_NONE
layout(location = POSITION) in float4 v_model_P ; // POSITION; // (float,float,float,1)
#else
layout(location = POSITION) in int4 v_model_P ; // POSITION; // (float,float,float,1) - quantized
#endif
#ifdef SKIN_0
layout(location = NORMAL) in float3 v_model_N ; // NORMAL; // (nx,ny,nz)
#else
Expand Down
4 changes: 0 additions & 4 deletions res/gamedata/shaders/gl/iostructs/v_model_shadow.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@

out gl_PerVertex { vec4 gl_Position; };

#ifdef SKIN_NONE
layout(location = POSITION) in float4 v_model_P ; // POSITION; // (float,float,float,1)
#else
layout(location = POSITION) in int4 v_model_P ; // POSITION; // (float,float,float,1) - quantized
#endif
#ifdef SKIN_0
layout(location = NORMAL) in float3 v_model_N ; // NORMAL; // (nx,ny,nz)
#else
Expand Down
4 changes: 0 additions & 4 deletions res/gamedata/shaders/gl/iostructs/v_model_shadow_aref.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@

out gl_PerVertex { vec4 gl_Position; };

#ifdef SKIN_NONE
layout(location = POSITION) in float4 v_model_P ; // POSITION; // (float,float,float,1)
#else
layout(location = POSITION) in int4 v_model_P ; // POSITION; // (float,float,float,1) - quantized
#endif
#ifdef SKIN_0
layout(location = NORMAL) in float3 v_model_N ; // NORMAL; // (nx,ny,nz)
#else
Expand Down
10 changes: 5 additions & 5 deletions res/gamedata/shaders/gl/skin.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@

struct v_model_skinned_0
{
int4 P ; // POSITION; // (float,float,float,1) - quantized // short4
float4 P ; // POSITION; // (float,float,float,1) - quantized // short4
float3 N ; // NORMAL; // normal // DWORD
float3 T ; // TANGENT; // tangent // DWORD
float3 B ; // BINORMAL; // binormal // DWORD
int2 tc ; // TEXCOORD0;// (u,v) // short2
};
struct v_model_skinned_1 // 24 bytes
{
int4 P ; // POSITION; // (float,float,float,1) - quantized // short4
float4 P ; // POSITION; // (float,float,float,1) - quantized // short4
float4 N ; // NORMAL; // (nx,ny,nz,index) // DWORD
float3 T ; // TANGENT; // tangent // DWORD
float3 B ; // BINORMAL; // binormal // DWORD
int2 tc ; // TEXCOORD0;// (u,v) // short2
};
struct v_model_skinned_2 // 28 bytes
{
int4 P ; // POSITION; // (float,float,float,1) - quantized // short4
float4 P ; // POSITION; // (float,float,float,1) - quantized // short4
float4 N ; // NORMAL; // (nx,ny,nz,weight) // DWORD
float3 T ; // TANGENT; // tangent // DWORD
float3 B ; // BINORMAL; // binormal // DWORD
Expand All @@ -30,7 +30,7 @@ struct v_model_skinned_2 // 28 bytes

struct v_model_skinned_3 // 28 bytes
{
int4 P ; // POSITION; // (float,float,float,1) - quantized // short4
float4 P ; // POSITION; // (float,float,float,1) - quantized // short4
float4 N ; // NORMAL; // (nx,ny,nz,weight0) // DWORD
float4 T ; // TANGENT; // (tx,ty,tz,weight1) // DWORD
float4 B ; // BINORMAL; // (bx,by,bz,m-index2) // DWORD
Expand All @@ -39,7 +39,7 @@ struct v_model_skinned_3 // 28 bytes

struct v_model_skinned_4 // 28 bytes
{
int4 P ; // POSITION; // (float,float,float,1) - quantized // short4
float4 P ; // POSITION; // (float,float,float,1) - quantized // short4
float4 N ; // NORMAL; // (nx,ny,nz,weight0) // DWORD
float4 T ; // TANGENT; // (tx,ty,tz,weight1) // DWORD
float4 B ; // BINORMAL; // (bx,by,bz,weight2) // DWORD
Expand Down

0 comments on commit 59a054e

Please sign in to comment.