eventhandler for vertex shader?
Moderator: GZDoom Developers
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
-
- Posts: 271
- Joined: Mon Jul 13, 2009 3:33 pm
eventhandler for vertex shader?
Now, I am aware that in order to have a vertex shader effect that I have to edit main.vp, and that i'll have to distribute gzdoom with my mod, which is fine because i'm not making a mod but rather a commercial game running on the GZDoom engine. So, I've done that, I've added a vertex shader effect into main.vp and it works, and it looks great. The issue is that I want it to be configurable. Where do I start in writing a script that will change the state of variables used by GZDoom's built in shaders? How do I add this option into one of the built in menus? I've been able to do it just fine with custom shaders and custom options menus but I'm still fairly new to these updates to GZD, so I'm not sure where to start at this point. Any help would be fantastic!
-
- Lead GZDoom+Raze Developer
- Posts: 48989
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: eventhandler for vertex shader?
Since the main shaders are considered to be part of the engine, much of their setup is hard coded. You will have to alter some C code as well and recompile a new binary. I won't go into detail how to do this but essentially you need some CVAR that gets passed to the shader as a uniform.
You also should be aware that if you alter the main shaders you may cut yourself off from future engine enhancements rather quickly because much of this interface is going to be altered once the Vulkan implementation gets a bit further. For modern hardware it would make sense to offload some of the C setup code to the vertex shader, and once that happens none of your changes would work anymore with an updated engine version.
You also should be aware that if you alter the main shaders you may cut yourself off from future engine enhancements rather quickly because much of this interface is going to be altered once the Vulkan implementation gets a bit further. For modern hardware it would make sense to offload some of the C setup code to the vertex shader, and once that happens none of your changes would work anymore with an updated engine version.
-
- Posts: 271
- Joined: Mon Jul 13, 2009 3:33 pm
Re: eventhandler for vertex shader?
Are there any plans to allow vertex shaders to be loaded from pk3s? Or would that be more work than it's worth?
-
- Lead GZDoom+Raze Developer
- Posts: 48989
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: eventhandler for vertex shader?
The main problem here is that this all is an integral part of the engine and subject to change. There's a reason why even for the fragment shaders all they can do is look up a texel color to be used in the processing chain. If users could exchange shaders at will there'd be no more possibility to add new engine features that require shader support.