SpiderPig Posted July 13, 2023 Share Posted July 13, 2023 Similar to what I mentioned here for materials. If I can get the index of an entity I can store extra data in a texture per entity. Unless there's already a way to do this? Quote Link to comment Share on other sites More sharing options...
klepto2 Posted July 13, 2023 Share Posted July 13, 2023 What i have found, is that the IDs are stored in the Render... classes, RenderMaterial, RenderTexture, etc. . These are all stored in private properties. There is a hackish way to access them (creating a separate class and modifying the original headers) but with every update this will be overwritten. I would like to add also Texture ID access, which might be useful for PostEffects. Maybe some static class extensions for the IDSystem like IDSystem::GetMaterialID(mat) IDSystem::GetTextureID(tex) ... 1 1 Quote Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
klepto2 Posted July 13, 2023 Share Posted July 13, 2023 3 hours ago, SpiderPig said: Unless there's already a way to do this? This is the hacky way without direct header access, but which needs to be updated when the class structure changes: struct PublicMaterial : public Asset { // copy everything from Material.h Material class here // remove the access modifier // remove all methods/constructors and friend functions }; // Call this in your loop auto refmat = (*sample_material); auto mat = reinterpret_cast<PublicMaterial*>(&refmat); auto materialId = mat->rendermaterial->id; 1 1 1 Quote Windows 10 Pro 64-Bit-Version NVIDIA Geforce 1080 TI Link to comment Share on other sites More sharing options...
SpiderPig Posted July 16, 2023 Author Share Posted July 16, 2023 Regarding your latest update @Josh Does the entities index change through out the program or is it set once and that it until it's deleted? Quote Link to comment Share on other sites More sharing options...
Josh Posted July 16, 2023 Share Posted July 16, 2023 it won’t change once it is assigned but it may not be assigned right away. 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 16, 2023 Share Posted July 16, 2023 Your code should handle the case whdd Ed n it returns -1. Pivots and as my other nonvvisible will return -1 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...
SpiderPig Posted July 16, 2023 Author Share Posted July 16, 2023 Perfect, thanks! Will put this to good use. 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.