On Thursday, January 17, 2013 13:16:03 Renk Thorsten wrote: > I've recently come across the idea of using one generic sand or rock texture > and selecting the particular hue desired by multiplying every pixel value > with an (rgb) vector - so rather than two different-colored sands, we'd > just store one texture and three numbers on disk (and potentially in GPU > memory, although mostly regionalizing means they won't occur together > usually) and save some space. > > I know materials.xml permits statements like > > <diffuse> > <r>0.9</r> > <g>0.95</g> > <b>0.9</b> > <a>1.0</a> > </diffuse> > > which seem to be going into that direction - do they actually do anything or > are they obsolete - I tried to modify one and wasn't able to see that I had > just set the red channel to zero, but maybe I made a mistake. At which > point are these values supposed to appear in the shader - gl_Color, or > gl_FrontMaterial.diffuse perhaps? > > Anyway, with a base texture created from six different overlays, we'd need > the possibility of passing a rotation vector for every overlay texture > separately to make this work. Technically it's easy to define the > corresponding uniform vec3 in the effect files - but in practice this means > about 18 more slots of uniforms used. Taken together with environment > sensitivity of the shaders and the strategy to make an ubershader > configurable from materials.xml rather than have a separate effect for > every landclass, we might end up having 50+ uniforms being fed into a > shader. > > I know an uniform is way cheaper than a varying since it doesn't need to be > tracked per vertex/fragment but only per draw, but is there a definite > number beyond we should be worrying? A color rotation strategy is not a > must-have, having an additional 300kb file on disk for a separate texture > file with colors rotated manually is not so bad a penalty, but it'd be nice > if there is no problem. Does anyone know for sure? > > Thanks, > > * Thorsten
That goes into gl_Color. I have found that gl_FrontMaterial.diffuse has issues on some ATI hw/driver combinations, in some cases. The uniform support varies wildly with gpu manufacturer/model/driver. (and some report the wrong number) For example here on an nvidia 8800GT with 313.09 linux driver I have: MAX_VERTEX_UNIFORM_COMPONENTS 4096 MAX_FRAGMENT_UNIFORM_COMPONENTS 2048 There are also quite a few built-in uniforms. Emilian ------------------------------------------------------------------------------ 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/learnmore_122712 _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel