Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 27 Aug 2009
Offline Last Active Oct 13 2016 01:34 AM

Posts I've Made

In Topic: Shader Performances

06 September 2016 - 01:18 AM

I will use 2 uvs set.

Thank you all for the help.

In Topic: Shader Performances

04 September 2016 - 05:13 AM



Tnx for you answer.


The current target engine is Unity, So I'm bounded to 2 sets of uvs.


Using a math function that transform the first uv's to the second uvs will not work for all cases. (curved ones).


I cannot modify the models automatically without having the artists to take a look. And doing it for a massive amount of

data is out of our bought).

In Topic: Shader Performances

04 September 2016 - 03:21 AM



Let my try explain it better.

I have to make a decision which cannot be undone later. Also, I cannot really test the impact on performances at the current

time, So I'm basing the decision based on articles I have read of (ATI/Nvidia) which says to try lower the amount of textures sampling

and push more ALU ops. Also I do know this effect will be very common > 90% of the drawing.

The artists will create a massive amount of data which cannot be fixed later on (Bought problem :( )


The problem:

The run-time generated uv's are used for overlay effect ( extra texture that is blended by alpha channels ).



A: Let the artist create the secondary uv channel via 3d app, and use them to sample a detail texture.


B: Create the uv's at run-time, and pay the price of sampling the same texture 3 times (Tri-Planer).


Please note that B is not revertible. If later I will find that the effect harms the performances, I cannot "Bake" the data back to UV's.


I wanted to spare the secondary uv as it will give me more flexibility later on. For example I can use it for : Light-maps, AO, ... 

In Topic: Shader performances

10 June 2016 - 09:28 AM

Thank you very much. I will definitely use your tips when I'll have a running scene.

In Topic: Shader performances

10 June 2016 - 07:11 AM

Very good answers.


I'm actually agreed with all the answers.

I'm treating the GPU as a big train which must not be stopped for a small amount of passengers. Option 1 helps to reduce the amount of shader variants, which helps for batching ( And can always be divided into sub-shaders later on ).

Level of detail will to reduce the shading Load. 


However, all the shaders used on games ( that I've seen ) used the pre-processor option to reduce the work... so I'm still confused about

that matter.  I remember OpenGL GDC lecture about zero driver over head, swapping shader was very expensive.

so I'm still trying to figure why the majority picks option 2.