Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17825

different meshes, different shaders.

$
0
0
Let's say I have a mesh that only has vertex position and UV's. Lets say I have another mesh that has position data and normals only. Let's say I have another one that has position, UV's and Normal data. Do I make a struct that is tailored for each mesh? One struct that has only position and UV and another that has only position and normals and so on? For shaders, do I do the same? One shader that takes in position and UV's and another that takes position and normals etc.... Then I render all the meshes that have things in common together? Or do I make one big struct that has UV, position, normals, binormal and tangent and send it to one shader? If I do it this way I'm sending extra unnecessary data to the gpu if one of the meshes doesn't have normals or UV's for example.

Viewing all articles
Browse latest Browse all 17825

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>