Any graphics engineers out there who structure their pixel and vertex shaders together? Because the two have to link together, I find it's easier to write 1 file with two entry points (ie, vs_main(), fs_main()) and then your UBOs and resources always match.
Using includes, you can then put the actual workload functions in other hlsl/glsl files. This takes some extra effort, as you have to specify the entry point when you compile, but it’s doable, and worth the one-time effort, if you ask me.
-
-
I didn't know you could specify an entry point during glsl compilation. Do you have an example of how to do this?
-
HLSL permits you define an entry point. I believe Glslang also does. You can also emulate it with define preprocessors, if need be. Can be a pain to deal with that way tho.
- Näytä vastaukset
Uusi keskustelu -
-
-
Using includes seems appealing but it can contribute to creeping functionality in your shaders until one day your render performance takes a nose dive because your shader code uses too.many registers.
Kiitos. Käytämme tätä aikajanasi parantamiseen. KumoaKumoa
-
Lataaminen näyttää kestävän hetken.
Twitter saattaa olla ruuhkautunut tai ongelma on muuten hetkellinen. Yritä uudelleen tai käy Twitterin tilasivulla saadaksesi lisätietoja.