Skip to content

Support GLES in internal shaders#7489

Open
Shivansps wants to merge 11 commits into
scp-fs2open:masterfrom
Shivansps:gles-shaders
Open

Support GLES in internal shaders#7489
Shivansps wants to merge 11 commits into
scp-fs2open:masterfrom
Shivansps:gles-shaders

Conversation

@Shivansps
Copy link
Copy Markdown
Contributor

@Shivansps Shivansps commented May 31, 2026

  1. Added conditional presicion quantifiers
  2. Implement software varying cull distance for GLES (the instruction to support hardware cull is very rare)
  3. For ES default-material glsl files were manually generated and copied directly
  4. Removed usage glBindFragDataLocation() for both GL and GLES now all fragOutN use location=N in shader.

Notes:
-there is a few prs modifiying shaders to keep in mind, its likely more changes are needed after those are merged
-There is a conflict in "envmap-sphere-warp-f.sdr"

layout(location=0) out vec4 fragOut0;

layout (location = 0) out vec4 outColor;

I added location 0 to fragOut0 as that is what glBindFragDataLocation() would have given it anyway, but its in conflict with outColor... I dont see being used.

-I noticed this on main-v.sdr L193

vec4 shadowPos = shadow_mv_matrix * modelMatrix * orient * vertPosition;
vertOut.shadowPos = shadow_mv_matrix * modelMatrix * orient * vertPosition;
vertOut.shadowUV[0] = transformToShadowMap(shadow_proj_matrix[0], 0, shadowPos);
vertOut.shadowUV[1] = transformToShadowMap(shadow_proj_matrix[1], 1, shadowPos);
vertOut.shadowUV[2] = transformToShadowMap(shadow_proj_matrix[2], 2, shadowPos);
vertOut.shadowUV[3] = transformToShadowMap(shadow_proj_matrix[3], 3, shadowPos);

shadow_mv_matrix * modelMatrix * orient * vertPosition; is done twice here?

Testing:
-Tested in icarus OpenGL with all detail with both shadown on/off and NoAA, FXAA, SMAA and MSAA no issues were noticed.
-Tested Icarus on GLES on my mali phone, all is good.

@qazwsxal
Copy link
Copy Markdown
Contributor

re: envmap I don't think outColor is actually used, so try deleting that line

@BMagnu BMagnu added the Waiting for Stable Marks a pull request that is to be merged after the next stable release, due to a release cycle label May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Waiting for Stable Marks a pull request that is to be merged after the next stable release, due to a release cycle

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants