On Mon, Jul 30, 2012 at 9:35 AM, Stuart Buchanan wrote: > On Fri, Jul 27, 2012 at 8:43 AM, Renk Thorsten wrote: >> It'd be really cool to be able to specify a few more parameters in >> materials.xml to be passed as uniforms - for instance we could then generate >> custom heightmaps for the terrain rather than hard-coded ones. Since I use >> tiling-less noise functions, we could easily get a 1cm scale heightmap for >> runway textures for instance, and we could give sand dunes same larger >> wavelength noises than rock. > > I can do this fairly easily. As mentioned previously, I think I'd > want to handle this as a generic framework allowing properties to be > defined in the materials.xml file that are then passed through to the > effects and can be used in the parameters section.
I've just pushed a change that allows a material definition in materials.xml to include a <parameters> section, which is merged with the <parameters> section of the effect. So you can now define parameters in the materials.xml file that can be used as uniforms in the effects file, and therefore shader. I haven't tested this particularly thoroughly beyond having half the water shader parameters in the materials definition, and half in the effects file. In particular the behaviour when you define the same parameter in both is untested. Enjoy! -Stuart ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Flightgear-devel mailing list Flightgear-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/flightgear-devel