How can I see the full source of a shader? Topic is solved

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


jwwalker
Goblin
Posts: 247
Joined: Thu Aug 12, 2021 10:06 pm
Location: San Diego, CA, USA
x 18

How can I see the full source of a shader?

Post by jwwalker »

I'm getting an error message
Metal SL Compiler Error in 100000002PixelShader_ps
followed by some details about the line on which the compile fails, but how can I see the full shader? I don't see any actual file named 100000002PixelShader_ps.
User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 479
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 167

Re: How can I see the full source of a shader?

Post by sercero »

What OGRE version?

Are you using RTSS?

There is a way to write the shaders to disk...
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5433
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1341

Re: How can I see the full source of a shader?

Post by dark_sylinc »

The shader source is dumped in Hlms::setDebugOutputPath

It's on in debug builds, off in release builds by default but can be overriden

I can't remember the default path in macOS since we ask the system for a user-writable path
jwwalker
Goblin
Posts: 247
Joined: Thu Aug 12, 2021 10:06 pm
Location: San Diego, CA, USA
x 18

Re: How can I see the full source of a shader?

Post by jwwalker »

OK, thanks. It wasn't working on macOS because it was trying to write into a directory that had never been created. I have opened a pull request #260 to fix it.