Hi Carsten,

On 01/30/2012 06:52 PM, Carsten Neumann wrote:
>
> thanks for the analysis. There is definitely something wrong with these lines
> (at the very least activate() and changeFrom() should behave the same way ;) 
> ).
> I'd say if ColorMaterial != GL_NONE the expectation is that the geometry has
> vertex colors to be used in lighting calculations (the whole point of
> glColorMaterial()), so the tests actually look backwards to me.
>
> Dirk: do you remember what the desired behavior here should be? To me it seems
> sensible to use the diffuse color as current color (on geometry with vertex
> colors those take precedence anyway) if ColorMaterial is GL_NONE.

I would agree. But I do remember going back and forth on this part, and there 
some situations that were problematic, I just don't remember exactly what they 
were.

For now I would do your change.

> Hmm, the only transforms that cause funny effects i can think of are ones that
> contain negative scale (possibly only on one axis, to go from left to
> right-handed coordinate systems). Is that (or something equally "unusual") the
> case here?
> The OpenGL traces you sent are very similar, the only difference is that in 
> the
> broken case three display lists (ids 3,4,44) are called while in the working
> case just one (id 45).

On 01/31/2012 05:06 AM, Michael Raab wrote:
 >
 > Ok, I think I may got the reason but I do not understand it. It seems to be 
the scale factor at the transformation core above the 3 geometries. The factor 
is (0.001, 0.001, 0.001). If I multiply that factor directly onto the vertices 
the rendering becomes correctly shaded. If I simply set this factor to (1.0, 
1.0, 1.0) the geometry is shaded correctly as well but unfortunately way to 
large.. ;-)
 > I would guess that this transformation is quite usual soI do not understand 
why this may cause problems...
 > I'll send you the geometry that causes that problems off the list.

Scales are always a problem with lighting, that's what GL_NORMALIZE is for. 
Normally that is always enabled in OpenSG (inside OSG::Window::setupGL, usually 
called from xxxWindow::init). I don't know how you setup your window, maybe you 
can check the OpenGL log to make sure glEnable(GL_NORMALIZE) is called.

Yours

        Dirk

-- 
Dirk Reiners                                            m...@dirkreiners.com

"God must really love stupid people. Why else would he make so many of them?"
                                                          Walter Rothschild

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to