Skip to content

Commit

Permalink
HnAxes.vsh: fixed GLES3.0 compile issues
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMostDiligent committed Nov 7, 2023
1 parent ff2e902 commit c1d9122
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions Hydrogent/shaders/HnAxes.vsh
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ void main(in uint VertID : SV_VertexID,
//Pos[10] = float3(0.0, 0.0, 0.0);
//Pos[11] = float3(0.0, 0.0, +1.0);
float3 Pos;
Pos.x = (VertID == 0) ? -1.0 : ((VertID == 3) ? +1.0 : 0.0);
Pos.y = (VertID == 4) ? -1.0 : ((VertID == 7) ? +1.0 : 0.0);
Pos.z = (VertID == 8) ? -1.0 : ((VertID == 11) ? +1.0 : 0.0);
Pos.x = (VertID == 0u) ? -1.0 : ((VertID == 3u) ? +1.0 : 0.0);
Pos.y = (VertID == 4u) ? -1.0 : ((VertID == 7u) ? +1.0 : 0.0);
Pos.z = (VertID == 8u) ? -1.0 : ((VertID == 11u) ? +1.0 : 0.0);

PSIn.Pos = mul(mul(float4(Pos, 1.0), g_Constants.Transform), g_CameraAttribs.mViewProj);
PSIn.Color = g_Constants.AxesColors[VertID/2];
PSIn.Color.a *= 1 - length(Pos);
PSIn.Color = g_Constants.AxesColors[VertID / 2u];
PSIn.Color.a *= 1.0 - length(Pos);
}
10 changes: 5 additions & 5 deletions Hydrogent/shaders_inc/HnAxes.vsh.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@
" //Pos[10] = float3(0.0, 0.0, 0.0);\n"
" //Pos[11] = float3(0.0, 0.0, +1.0);\n"
" float3 Pos;\n"
" Pos.x = (VertID == 0) ? -1.0 : ((VertID == 3) ? +1.0 : 0.0);\n"
" Pos.y = (VertID == 4) ? -1.0 : ((VertID == 7) ? +1.0 : 0.0);\n"
" Pos.z = (VertID == 8) ? -1.0 : ((VertID == 11) ? +1.0 : 0.0);\n"
" Pos.x = (VertID == 0u) ? -1.0 : ((VertID == 3u) ? +1.0 : 0.0);\n"
" Pos.y = (VertID == 4u) ? -1.0 : ((VertID == 7u) ? +1.0 : 0.0);\n"
" Pos.z = (VertID == 8u) ? -1.0 : ((VertID == 11u) ? +1.0 : 0.0);\n"
"\n"
" PSIn.Pos = mul(mul(float4(Pos, 1.0), g_Constants.Transform), g_CameraAttribs.mViewProj);\n"
" PSIn.Color = g_Constants.AxesColors[VertID/2];\n"
" PSIn.Color.a *= 1 - length(Pos);\n"
" PSIn.Color = g_Constants.AxesColors[VertID / 2u];\n"
" PSIn.Color.a *= 1.0 - length(Pos);\n"
"}\n"

0 comments on commit c1d9122

Please sign in to comment.