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.
Well... At the moment glsl. I've tended toward this design in hlsl as well. At a previous job, this sort of thing was more or less strictly enforced by a technique-like wrapper language. I'm interested in what makes a difference. Literally trying to sponge knowledge rn.
-
-
OK this gets into bikeshed territory quickly, but for the renderer I have on-hand that uses GLSL, what I have are interface .glsl files that are included to both vert and frag files. I have a special macro called vf_bind. Then at compile time, I use preprocessor magic to ...
-
... convert this to "in" or "out" depending on the type of the shader being compiled. Now, the binding index is shared, the variable names are the same, and the types are the same too. Also, the interface can be reused across multiple shader programs
Keskustelun loppu
Uusi keskustelu -
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.