Skip to content

Ported shaders from Cg to OgreUnifiedShader (OGRE 14.4+) - #23

Draft
ohlidalp wants to merge 16 commits into
OGRECave:masterfrom
ohlidalp:cg_begone
Draft

Ported shaders from Cg to OgreUnifiedShader (OGRE 14.4+)#23
ohlidalp wants to merge 16 commits into
OGRECave:masterfrom
ohlidalp:cg_begone

Conversation

@ohlidalp

@ohlidalp ohlidalp commented Oct 12, 2025

Copy link
Copy Markdown
Contributor

This is a spinoff from #21 - when complete, I'll make it standalone and squash it to single commit.

I don't exactly know what I'm doing, but I'm following the docs and log:

  • Shader files are named by the original entry point names, I used the *VP and *FP naming everywhere.
  • I introduced gl_Position and gl_FragColor outputs, removing the manually declared POSITION/COLOR 'out' params.
  • I eliminated -DHAZE_DEPTH_TEXTURE=s2 because SAMPLER2D() cannot evaluate it. It was "s2" everywhere anyway.
  • I commented-out the profiles declaration just minimize space for errors by letting OGRE go with defaults. UPDATE: Uncommenting where I get problems like error X5608: Compiled shader code uses too many arithmetic instruction slots (75). Max. allowed by the target (ps_2_0) is 64.

Status:

  • Unless I comment-out the LoadLegacyTerrain() line, I get exception "vertex shader %sha1%_VP consumes semantic NORMAL but none provided in vertex" - looks like terrain system doesn't obey the vertexnormals setting.
  • If I do comment it out, CaelumDemo starts up and I see the TudorHouse mesh, textured. No sun or clouds though, only clear sky.

@paroj

paroj commented Oct 16, 2025

Copy link
Copy Markdown
Member

ignore the terrain for now and port individual shaders from Cg/ HLSL to UnifiedShader and visually verify that results are the same.
As Cg is the same as HLSL (D3D9) you may want to to use that as an intermediate step to UnifiedShader.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants