Problem solved, and of course it was the simplest thing.. again.. sigh..
I was neglecting to do CPEdit(chunkmaterial, chunksfieldmask), although
I'm currently running single-threaded and all. (It worked without that
in many other places, so I didn't think of that until now.)
Thanks for your comments though, they did help me to pinpoint the
problem! (This maillist & it's users rule :)
*thinking*
This write-locking via objects is a bit user-error-prone. I wonder if
there was some better way to do it.
Perhaps forcing (or at least providing a method that allows) access to
the object to happen between a begin/end-pair via a function on a FCPtr
that returned some smart-pointer/lock object which allowed access to the
non-const member functions of a field container.
I.e. I'd like to do something like the following (in principle):
ConstFCPtr<Node> mynodeptr(Node::create());
Mutator<Node> m(mynodeptr, Node::ChildrenFieldMask);
// or NodePtr::Mutator m = mynodeptr->write(Node::ChildrenFieldMask);
m->addChild();
m->subChild();
and Mutator being something like:
template <class T>
struct Mutator {
Mutator(ConstFCPtr<T> &ptr, int masks)
: m_ptr(const_cast<T::Ptr>(ptr)),
m_edit(ptr.get()), mask)
{ }
T::Ptr operator->() { return m_ptr; }
T::Ptr m_ptr;
CPEditor m_edit;
}
Perphaps you've already thought about something like this?
/Marcus
Andreas Zieringer wrote:
Hi Marcus,
yes the file looks ok. Really strange I do such stuff quite often in my
app and it works fine. Can you send us some code where you apply the
materials or better a small test app to reproduce this behavior?
Andreas
As posted previously: http://yar.nu/macke/scene.osb
However, loading that file works, as I wrote in reply to Dirk's reponse.
What could it be that makes things work by saving/reloading the scene?
/Marcus
Andreas Zieringer wrote:
Hi Marcus,
hmm no idea what's wrong, can you write a osb file out and put it
somewhere on the net.
Andreas
Hi all,
I'm having stupid problems with materials.
When I create and use my own material (even if I use a
SimpleMaterial), I only get a all-white rendering, no matter what I
do. The chunks do not seem to be applied eiter, since my
vertexprogram with purposeful gross syntax error in it is ignored.
The predefined material set by the vrml-loader works nicely though
(adding chunks and everything. I've got normalmapping already. Yay!)
However, when I create my material from scratch I don't get any
respect at all. What I do is to simply traverse the graph and call
setMaterial() for all materialgroups and geometries encountered. I
assume this is the proper way to do it.
Dumping the scene afterwards shows the material being attached, but
the rendering is still very screwed.
Again, this is probably something very simple (like last week's
problem), but I'm stumped after working on it for 5 hours. Also, I'm
just learning how to debug my stuff efficiently so there might be
something obvious I've missed.
All help gratefully accepted!
Best regards,
/Marcus
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great
events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great
events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users
-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r=20
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users