Jump to content

Ultra's Limits


SpiderPig
 Share

Go to solution Solved by Josh,

Recommended Posts

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?
  • Upvote 1
Link to comment
Share on other sites

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.

  • Like 1
  • Thanks 1
  • Windows 10 Pro 64-Bit-Version
  • NVIDIA Geforce 1080 TI
Link to comment
Share on other sites

  • Solution

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.

  • Like 1
  • Thanks 1

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

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. ^_^

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...