SpiderPig Posted July 13, 2023 Share Posted July 13, 2023 Can we not set a vertex's tangent or bitangent in Ultra? I only found these in the Mesh class for vertices. virtual void SetVertexPosition(const uint32_t v, const Vec3& position); virtual void SetVertexNormal(const uint32_t v, const Vec3& normal); virtual void SetVertexTexCoords(const uint32_t v, const Vec2& texcoords, const int index = 0); virtual void SetVertexColor(const uint32_t v, const Vec4& color); Quote Link to comment Share on other sites More sharing options...
Josh Posted July 13, 2023 Share Posted July 13, 2023 Why not just call UpdateTangents to calculate them? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
SpiderPig Posted July 13, 2023 Author Share Posted July 13, 2023 I like the control over them myself. I think being able to set them would be good. In other words, I want to use them to store other values in a custom shader. Quote Link to comment Share on other sites More sharing options...
Josh Posted July 13, 2023 Share Posted July 13, 2023 They get converted into a quaternion so they can be stored in four bytes. I got the idea from Crytek. 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Josh Posted July 13, 2023 Share Posted July 13, 2023 You might be able to store your data in a texture, and then use the vertex ID as the lookup to get the extra data you want to retrieve. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
SpiderPig Posted July 13, 2023 Author Share Posted July 13, 2023 4 minutes ago, Josh said: They get converted into a quaternion so they can be stored in four bytes. I got the idea from Crytek. I've been looking through every piece of shader code for some wiggle room but you've stripped everything down to the bare minimum number of bytes needed so there's no room left for me. But this is why Ultra is fast. 3 minutes ago, Josh said: You might be able to store your data in a texture, and then use the vertex ID as the lookup to get the extra data you want to retrieve. I was thinking that too. I wanted to see if there were other ways first before I started on this. Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.