SpiderPig Posted July 16, 2023 Share Posted July 16, 2023 Just want to get a clear idea on what are some of the limits for these things so I can be sure to not exceed them. As I understand it only so many materials, textures, entities and maybe other things can be passed to the shaders. What are the max: Entities Materials Textures Any thing else? 1 Quote Link to comment Share on other sites More sharing options...
klepto2 Posted July 17, 2023 Share Posted July 17, 2023 From what i remember the only limitations which are set within the shaders are the different textures types: Limits.glsl: #define MAX_TEXTURES_2D 512 #define MAX_TEXTURES_CUBE 128 #define MAX_TEXTURES_SHADOW 64 #define MAX_TEXTURES_2D_INTEGER 32 #define MAX_TEXTURES_2D_UINTEGER 32 #define MAX_TEXTURES_CUBE_SHADOW 128 #define MAX_VOLUME_TEXTURES 128 #define MAX_TEXTURES_STORAGE_2D 32 #define MAX_TEXTURES_STORAGE_3D 128 #define MAX_TEXTURES_STORAGE_CUBE 128 #define MAX_TEXTURES_2DMS 32 #define MAX_IMAGES_2D MAX_TEXTURES_2D #define MAX_IMAGES_3D 128 #define MAX_IMAGES_CUBE 128 Everything else should just be limited by the available memory. You can also alter this file to your needs, but you need to recompile the shaders when you do so. Which will be complicated if you rely on the terrain shaders as they are currently not available via source. 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 17, 2023 Author Share Posted July 17, 2023 Okay thanks. So it's pretty much just a memory game. I thought there might also be a maximum amount of entities and materials too as the shaders look them up in an array. Maybe those arrays have no set size like the textures do. Quote Link to comment Share on other sites More sharing options...
Solution Josh Posted July 17, 2023 Solution Share Posted July 17, 2023 Currently, there are these constants set: const int maxobjects = 65536; const int MaxVertices = 1000000; const int MaxIndices = 100000; const int MaxIndirectDraws = 1024; const int MaxMaterials = 256; const int MaxSkeletons = 1024; The vertex and indice count seems a bit low. I plan to add an Initialize() function that will let you define these caps in a structure. Some of them require you to recompile shaders so the array sizes match. Max entities will stay at 65536 because the engine uses two bytes to refer to the index. This does make a difference in speed because bandwidth is a big bottleneck I try to minimize A specialized vegetation system can be used in the future to add more. Some of the maps in Leadwerks had several million trees. 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 17, 2023 Author Share Posted July 17, 2023 Ah yes thanks. MaxVerticies and MaxIndices is total for a single mesh or entire program? They probably are a bit low. Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted July 17, 2023 Author Share Posted July 17, 2023 Can I retrieve the current amount of all those values in C++? Quote Link to comment Share on other sites More sharing options...
Josh Posted July 17, 2023 Share Posted July 17, 2023 Total No 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 17, 2023 Author Share Posted July 17, 2023 Can support for retrieving the current amounts be added or do we wait for a crash? Quote Link to comment Share on other sites More sharing options...
Josh Posted July 17, 2023 Share Posted July 17, 2023 I just told you the current amounts. 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 17, 2023 Author Share Posted July 17, 2023 But I have no way of tracking them. I mean my project is large and materials are being created and deleted left right and centre. I've already discovered I'll need to move all my icons for inventory items into one texture and draw them in the inventory via manipulating tex-coords. If I don't know how many there currently are I don't know where to make improvement's. 256 materials will be used pretty quick, that's only 256 unique objects. Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted July 17, 2023 Author Share Posted July 17, 2023 I think they should be added to the world stats. Quote Link to comment Share on other sites More sharing options...
Josh Posted July 17, 2023 Share Posted July 17, 2023 I'm putting it into the EngineSettings structure. 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...
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.