Hi Josef,

On Wed, 2006-03-01 at 11:29 +0100, Josef Grunig wrote:

> That is not working for me; I already tried that because I supposed
> the behaviour you explained here right now.
> 
> The shader is OK because it works well with TextureChunk Nodes.
> Instead, adding a shader and two textures to a SimpleTexturedMaterial
> it got rendered black.
>
> Strange behaviour: if in the same model, with two different
> geometries, I have both SimpleMaterial with a TextureChunk (which
> works) and a SimpleTexturedMaterial, the second one gets rendered with
> the SimpleMaterial's texture .
>
> I do this:
> 
> GeometryPtr geo = GeometryPtr::dcast(curNode->getCore());
> ChunkMaterialPtr material = ChunkMaterialPtr::dcast(geo->getMaterial());
> if( material != NullFC ){
> 
>   SimpleTexturedMaterialPtr texturedMaterial =
> SimpleTexturedMaterialPtr::dcast(material);
>   if (texturedMaterial != NullFC){
> 
>      // found SimpleTexturedMaterialPtr
>     texturedMaterial->addChunk(shader);
>     texturedMaterial->addChunk(texture1, 1);
>     texturedMaterial->addChunk(texture2, 2);
> 
>   }
> 
> }
> 
> a workaround for me was to manually add (before my textures and
> shader) a new textureChunk with the image taken from the
> SimpleTexturedMaterial.

Hmm, that smells fishy. I think I have an idea. The local chunks in the
SimpleTextureMaterial are added after the chunks from the ChunkMaterial.
Given that you use units 1 and 2, 0 should be free and used. Turns out:
not so. There was a bug in the SimpleMaterial/SimpleTexturedMaterial
about handling of chunks. Should be fixed now. 

> Could it be a bug?

That's always a possibility. Like in this case. Thanks for spotting
it. ;)

Thanks

        Dirk
 



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to