Ah, now I understand what Mathias is after:

> That would be ok if this would be optional in the sense that it does not
> impact what is there performance wise. But since this is all runtime  
> configured
> by an uebershader with a lot of uniforms this is not the case. Any  
> additional
> feature done in this way *does* impact everbody in several ways. Any
> additional uniform takes time to be set up in the driver. Any code that  
> is in
> the shader and that cannot be optimized away at *link* time of the  
> shader may
> take registers which affects the partitioning and the amount of paralell
> executed threads in the GPU. At least a notable amount of gpu's on the  
> market can get register set limited at that point.

This paragraph has nothing to do with what is actually happening.

1) The 'ubershader' for _models_  (model-combined-deferred.eff and 
ubershader.vert/frag) has not been introduced by myself but by "Frederic 
Bouvier and Gijs de Rooy with major additions and revisions by Emilian Huminiuc 
and Vivian Meazza 2011" (says so in the shader code). That shader requires to 
insert <generate> tags into each model which uses normal maps. The shader is 
optional, i.e. it is not compiled if model shader quality is set to zero. It is 
configured by a lot of uniforms (really a lot more than I ever used for 
terrain). 

My own contribution with regard to this shader is just to change the light and 
fog functions, I did not otherwise alter its design. However, since there's 
lightmap, reflection map, normal map and dirt map, there are potentially 15 
different combinations of dedicated shaders which are not configured by 
uniforms, it seems to me there may be a maintenance issue to consider and it 
makes sense to do it that way.

I did not come up with the need to modify each model, that is a property of the 
original shader. Mathias, you picked the wrong audience.

2) The terrain 'ubershader' (terrain-haze-detailed.vert/frag and 
terrain-haze-ultra.vert/frag) is my own work. These are two quality levels of 
procedural *terrain*  texturing with terrain-haze.vert/frag being the 'bare' 
light scattering framework without any terrain effects, just modifying light 
and fog.

This shader is very different from the model ubershader and does *not* require 
any insertion or modification of any model. All of these shaders are only 
compiled if the respective quality level is actually used and atmosperic light 
scattering is actually checked.

3) terrain-haze-detailed.vert/frag still has if-clauses linked to quality level 
in - however the plan (made on this list) is to take them out as I recognize it 
doesn't help for performance. This has largely been done in 
terrain-haze-ultra.vert/frag already.

It would have been 5 minutes effort for Mathias to take a look into our effect 
files to see how all this is actually implemented and to realize that none of 
the shaders being discussed here is compiled unless this is asked for by the 
user.  But it would appear his criticism is not based on any understanding of 
the situation, but just on his interpretation of bits and pieces of messages 
out of context. So, I will disregard it as unfounded.

Mathias, please next time have a look at what you are against before you start 
writing. Thanks,

* Thorsten
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to