Hi Carsten,

yes, it works fine for me. I said I'm not used to OpenSG coding... ;-)
Anyway my code comes from the basis of the
RenderAction::getMaterialStates() method; probably there might be some
possible refactoring too.

You may have noticed I've added a GLMatrixMode(GL_PROJECTION) before
the second last glPopMatrix() in the draw function.
I did that because I get a GL_STACK_UNDERFLOW when rendering (only in
the PolygonForeground) some MultipassMaterials.
I supposed that the state activate or the deactivate of some chunk
changes somehow the matrix mode to GL_MODELVIEW, while it seems
expecting GL_PROJECTION

Here are the chunks involved in the material:
* MaterialChunk
* PolygonChunk
* BlendChunk
* TextureChunk
* TextureGenChunk
* TextureTransformChunk

Bests,

Josef

On Tue, Feb 8, 2011 at 8:21 PM, Carsten Neumann <carsten_neum...@gmx.net> wrote:
>        Hello Josef,
>
> On 02/08/2011 03:42 AM, Josef Grunig wrote:
>>
>> I've noticed that Multipass Materials weren't correctly handled by
>> OpenSG 1.8 when added to a PolygonForeground:
>>
>> http://www.mail-archive.com/opensg-users@lists.sourceforge.net/msg07826.html
>>
>> Here I attach the whole cpp I modified starting from a quite old
>> revision of OpenSG. Sorry no diff because of server being down.
>> Should work for SwitchMaterial and MultipassMaterial. I'm not handling
>> CGFXMaterials, because don't know much about that material.
>>
>> Please have a look at the source, I'm not that confident in coding in
>> OpenSG...
>
> thank you for the contribution. Looking over the code I was wondering if the
> attached, simpler code wouldn't work too? I assume you have a use/test case
> for this, I'd really appreciate it if you could give this version a try,
> since it does not require explicit knowledge about Switch- or
> MultiPassMaterial, thanks!
>
>        Cheers,
>                Carsten
>
> ------------------------------------------------------------------------------
> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
> Pinpoint memory and threading errors before they happen.
> Find and fix more than 250 security defects in the development cycle.
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb
> _______________________________________________
> Opensg-users mailing list
> Opensg-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/opensg-users
>
>



-- 
Josef

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to