Switch between DrawList

1 view
Skip to first unread message

drnk

unread,
Sep 25, 2010, 5:47:32 AM9/25/10
to O3D-discuss
Hello,

is it possible to switch an exisiting Transform from one "view" to
another (Like one Transform is in foreground and then drawn in
background)?

Or: How can i change the drawlist of an existing material?

Thanks for your answers :-)

Peterson Trethewey

unread,
Sep 27, 2010, 5:09:16 PM9/27/10
to o3d-d...@googlegroups.com
Changing the drawlist of a material should be as easy as setting the
drawList member variable, but I doubt that's the best way to achieve
what you need. It sounds like you want a rendergraph more like the
one in the hud-2d-overlay.html sample except you want to send the
overlay to the background. If that's what you need, I suggest making
separate drawpasses with a clearbuffer between them in priority, set
the clearbuffer's clearColorFlag to false. Then the clear buffer will
only clear the depth and the second draw pass will draw in the
foreground. To send it to the background, exchange the priorities of
the draw passes. Tell me if I'm way off; maybe I don't understand
what you're trying to do.

--pt

> --
> You received this message because you are subscribed to the Google Groups "O3D-discuss" group.
> To post to this group, send email to o3d-d...@googlegroups.com.
> To unsubscribe from this group, send email to o3d-discuss...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/o3d-discuss?hl=en.
>
>

drnk

unread,
Oct 9, 2010, 6:42:13 AM10/9/10
to O3D-discuss
Hi! :-)

Example: http://drnk0r.bplaced.net/

Well atm im using two drawList (g_viewinfo and g_foreground).
g_foreground has the g_viewinfo priority+1;
The Problem is: I need two materials.
I have to create a material for the objects in Background (g_Viewinfo
Z-Ordered) and for the foreground (g_foreground Priority), cause i
could not find a way to change the viewinfo in the material.
Im creating material like below:

var material = o3djs.material.createMaterialFromFile(
g_picturepack,
'shaders/texture-colormult-glsl.shader',
this.viewInfo.zOrderedDrawList);

material.getParam('colorMult').value = [1, 1, 1, value];
material.name = 'transparent';

I just need a way to change the viewinfo of the materials.

Thanks for your help :-)
Reply all
Reply to author
Forward
0 new messages