Christoph Fuenfzig wrote:



Dirk Reiners wrote:

  Hi Akos,

Sorry, been there tried that. :) The problem is the following: the
experimental VRML loader doesn't assign Materials to the Geometries
loaded, but uses MaterialGroup Nodes -- whatever they might be (couldn't
find any docs on that).

Just an override for the underlying Geometries. Keeps a Material that is
used for all of those, that's all.

Those MaterialGroups do contain a Material, but it seems to be
ChunkMaterial (when casting to a SimpleMaterial all I get is a NullFC,
while casting to a ChunkMaterial works fine). And as the ChunkMaterial
doesn't have a setLit() method, I'm stuck there. Any other suggestions? :)

True, but the ChunkMaterial keeps Chunks. You'll have to find the
MaterialChunk in the chunks field and use its setLit method.

(Apart from parsing the file by hand, and constructing my own Geometries.
:) I might resort to that in the end anyway, as loading the biggest model,
a 153MB VRML model just takes _ages_.

Yup, flex and bison, especially on models with very large arrays, take
quite a long time. I recommend using .bin for large models, which will be
significantly faster.

BTW I've noticed in the docs at the opensg.org site that there's a
PhongMaterial now which seems to be awfully similar to the SimpleMaterial,
is SimpleMaterial deprecated now? :) My CVS snapshot doesn't even have
PhongMaterial...

Nope, SimpleMaterial is still recommended, PhongMaterial is just a first
version of using VP/FP to do Phong lighting and shading that Andreas
wrote. It's not fully flexible in terms of light sources etc. yet, so it's
not a replacement for the standard stuff.

Interesting: PhongMaterial does Phong per pixel lighting?

yes, but you need a graphics card with vertex and fragment shader.

Do you need a normal map for that or does it interpolate the normals given at vertices?

It interpolates :-) But it is limited to one point light and one texture. Just try the testPhongMaterial.cpp example program.

Andreas




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to