Stuart Buchanan a écrit :
> Hi All,
>
> Just a quick note to mention that I've now implemented random tree height, and
> multiple textures as suggested by Curt. Screenshot here:
>
> http://www.nanjika.co.uk/flightgear/forest2.jpg
>
> Still some work to be done, but it is looking more realistic.
>
Impressive
> Tim - I've been cleaning up my code a bit, so unless you've already started,
> I'd
> hold off trying to kick my previous patch into shape for CVS. I should have a
> new
> patch fairly soon.
>
> Two other questions for Tim, or anyone else familiar with OSG/OpenGL:
>
> 1) For the diffuse lighting, presumably I should calculate the normal when
> creating the geometry, and it will appear as gl_Normal in the shader right?
>
According to the orange book, yes
> 2) I've been finding it impossible to work out how to pass in generic
> attributes
> into the shader. I've managed to bind an attribute to a location using
> program->addBindAttribLocation("textureIndex", 1); but I can't seem to set the
> attribute afterwards. I should be able to use glVertexAttrib... functions, but
> they don't compile on Visual Studio. Any ideas ?
>
Why not using osg::Geometry::setVertexAttribArray instead of raw gl
functions ? Standard OpenGL under windows is 1.1. Extensions have to be
loaded manually. OSG should do it for you.
-Fred
--
Frédéric Bouvier
http://my.fotolia.com/frfoto/ Photo gallery
http://fgsd.sourceforge.net/ FlightGear Scenery Designer
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Flightgear-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/flightgear-devel