Frictional Games Forum (read-only)

Full Version: Soma Custom GLSL Shaders
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I'm looking for a way to modify or make new custom shaders in GLSL, is it possible at all ?

I've tried to modify the shadersource.hpss but changing a line will crash the engine, but I see that shadercache.xml store all start and end lines for all shaders but it's a nightmare to edit by hand so I'm looking for an easy way Wink.

Thanks.
I've been looking into this for months. There's no "easy" way to edit the existing shaders, and there's no way to create entirely new shaders at all. What I can say though is that I don't think the ".hpss" file is what you should be looking at. The shader files themselves are in "core/shaders/hpsl", and are all have the ".hpsl" extension. I think "shadersource.hpss" and "shadercache.xml" are intermediary files that the game generates when it detects the shaders need to be recompiled, and if so, you shouldn't need to mess with it.

The shader language they use is a custom one that is based on GLSL, but this blog post is the only place I've been able to find them talking about it at all. It does a good job at breaking the language down for people who want to write their own shaders, but doesn't provide any relevant information for how to actually utilize them in the game. All the existing shaders are used via helper methods in the script, but where those methods and the shaders interact seems to be buried in the engine itself.

If you come across any new breakthroughs, be sure to come back and let us know. Until then, good luck. Smile
"I think "shadersource.hpss" and "shadercache.xml" are intermediary files that the game generates when it detects the shaders need to be recompiled"

Yeah make sense of course Smile.

I don't even know how I could have missed that core folder !

Ok, from what I can see, I can quite easely change their shaders but yeah I need to dig more for a custom one.

Thanks for your reply !

Will keep this thread up to date !