On Thursday, January 10, 2013 08:03:39 Renk Thorsten wrote: > > Which reminds me - is there a performance penalty for using many uniforms? > My impression is not, at least I've never seen any, but it'd be good to > have this confirmed. Also, can be declare uniform vec 3 in the effect > files, and if so, what is the syntax? . > > * Thorsten
You could run out of uniforms on some gpu/driver configs, and those could be dropped silently and then you end up with undefined behaviour in the shader. For vec3 uniforms in effects syntax is like this: <uniform-name type="vec3d" > 1.0 1.0 1.0 </uniform-name> BTW: I've been discussing with the terragear guys something similar, with a texture encoding material info accompanying the btg, and being generated at scenery build time. This texture would use a secondary set of texture coordinates, relative to in-tile position, and would be read in the fragment shader, determining the actual texture patch(es) to be used from a texture-atlas(sheet), and amount of mixing. There are issues with relying on the interpolation in the vertex shaders, especialy with the irregular mesh model we have. You get long streaks along "stretched" triangles, making edges in the mesh visible, basicaly creating "starred" artifacts around the vertices, reading the info from a texture in the fragment insures this doesn't happen. Anyway this is only in the theoretical stage right now. 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