Is there a good way to store data per edge in a mesh for read on the GPU, or are you better off just storing that data per triangle, even though it is likely redundantly stored on the triangle that shares the edge?
-
-
Vastauksena käyttäjälle @Atrix256
Vertex fetching with no real index buffer, but instead have a buffer that is the basically wavefront obj style indices. You can end up storing pretty much anything pretty arbitrarily and without duplication.
1 vastaus 0 uudelleentwiittausta 3 tykkäystä -
Vastauksena käyttäjälle @tloch14
Could you spell it out a little bit more, like how youd store and retrieve the data (like, the index where edge data lived, how you'd find it)
1 vastaus 0 uudelleentwiittausta 0 tykkäystä -
Vastauksena käyttäjälle @Atrix256
Drafted this up real fast to prove the point but it probably won't compile. Been in glsl land for awhile but wrote it in as best I remember hlsl, so my syntax may be off.pic.twitter.com/SKr6vkTpid
2 vastausta 0 uudelleentwiittausta 2 tykkäystä -
I've done a similar thing with quad-based anything. Particles and terrain are easy ones. particleId = vertexId / 6; indexInQuad = vertexId % 6; quadIdx = quads[indexInQuad]; //another LUT. Mean you can do terrain rendering with no index or vertices. Just textures.
1 vastaus 0 uudelleentwiittausta 1 tykkäys -
The key to making this work is that the "entry" buffer (ie, the indices in the wavefront obj) are linearly ordered, where you know that all three points of a triangle are contiguous.
1 vastaus 0 uudelleentwiittausta 1 tykkäys -
Once here, you can start sharing components of the index uint4 where it makes sense. ie, normal, binormal, and tangent can all be indexed with y. Vertex weights (for animation) can probably be indexed by x, which also grabs positions. Color on x too?
1 vastaus 0 uudelleentwiittausta 0 tykkäystä
w is a freebie. Second UV set? If all UV islands are the same between two uv sets, you might be able to re-use z for both uv sets. Point is there is a bit of room to play around here and get creative.
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.