Fading 3D objects

Nov 10, 2009 at 10:17pm

Fading 3D objects

Hi ladies and Jits,

Sorry if its common openGL knowledge, but couldn’t find how to fade any 3d object (in my case: a text3D overlayed over a videoplane). I’ve tried with the alpha of the color of the text, but that disn’t work, sadly. Any tips?

#46392
Nov 11, 2009 at 7:41pm

post your patch and we’ll help you fix it.

#167003
Nov 11, 2009 at 8:41pm

My patch is basically jit.gl.text3d.maxhelp, except I have more than 1 text3D and I use jit.gl.videoplane instead of a mesh and a texture. The effect wanted is to fade in and fade out the text in front of a video: to control the transparency/opacity of the 3D text, sorry if that wasn

#167004
Nov 11, 2009 at 9:00pm

set @depth_enable 0 and @blend_enable 1 on your jit.text3d.
adjust the alpha value of the @color attribute to fade.

#167005
Nov 11, 2009 at 9:58pm

Thanks, that’s almost it, I can feel its coming along:

Setting the text to blend_enable 0 and depth_enable 0: text dissapears behind the videoplane.

Setting the text to blend_enable 1 and depth_enable 1: text blends with the grey background and not with the videoplane.

Setting the text to blend_enable 0 and depth_enable 1: alpha doesn’t change the text opacity.

Setting the text to blend_enable 1 and depth_enable 0: text dissapears behind the videoplane.

Then I tried playing with the blending parameters of the videoplane itself, but cannot find the right killer combo…

#167006
Nov 11, 2009 at 10:12pm
robtherich wrote on Wed, 11 November 2009 12:41
post your patch and we’ll help you fix it.
#167007
Nov 11, 2009 at 10:33pm

Let

———-begin_max5_patcher———-
2997.3oc4cs0iiZjE94NR4+PIq7vtRcPT2KxSYRTzp75l7VTTKrc0cSFL3.3
d5jn8+9VTEXarMzkgBv8LZFY2b+TebteNU4+4q+p6VrL8UY9Bv2A9Mvc28Op
8bmdek64t5cb2hMgutJNLWehK1HyyCeRt39pCVHesPe.38.e.z22e+gR1sIc
WQrrPekv5c+XZRQR3Fo9p9PVTX79qvb5E+0VognVr.760GKZs9BRW9GeKQr3
3aVdzeqOeHziFPgBd8A2FVr54njmdHStpvbGoBhm+8.je4mzfxOgBO+COFEQ
GkTSyH8N+ee8WU9s5q6GNLU9.mHXBy5OLg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
lGGJgvwwIcFQGMAz7ihPsS5b2ECqULivq0xua3Fsl1PSe.DVoalLSQ2XkMY9
UKFSP5rWQMk.Bin62xMNBAGGx9XBcDHawMb.QVIdimGiMDqHN9UmplxNcUu.
lV8CJzgsbClBGIxlPFSxVXEYaxo4UElAmQ8Bp5Q1pNsfSMIvz2UhXL67D9pC
QhS0VWwlpNxQj8a4FLGYOleUlv3PxYXNx0XN2ZL+pnclJrzCXNKP3IvXLD6T
fGaOvCu1TyeBvyBbMvKrF3uNZ2ju2Zfmi8fLU.1bWB7VojgMOY4BZmzHdV70
kXEwQvyikZ7HUABAaLq.gvtt.fcKGpcqtlAGU+FsR2OddjiQVojAymEjKvJd
tfYJb.6py9LkWrS7dqE0yAyBwIrqZ3yCwYmoia4LJxnyhvJiZmahWsRXh1kv
pY5DhueC2XMFNPptcGDMIFAcDUWtg6Dugi.USXZ+XYhRZldfzQNKAOAAiDf6
FpyJa0Ayis5.h0D2LjeYqTpGLbk5k6P80+GPvSh4d
———–end_max5_patcher———–

#167008
Nov 11, 2009 at 11:04pm

the following works fine over here.

– Pasted Max Patch, click to expand. –
#167009
Nov 11, 2009 at 11:10pm

It does work! I’m not sure why yet, but I’ll meditate on your patch for awhile.
Thanks a lot!

#167010
Dec 17, 2009 at 6:38pm

I finally had time to go back to this project, and now the problem is slightly different: is it possible to fade 3Dtext with depth and lighting so that it really looks like 3D text?

For now, its one or the other. I’ve played with blending modes, couldn’t get it. here’s the patch:

– Pasted Max Patch, click to expand. –
#167011
Dec 18, 2009 at 7:47pm

if you want depth_enable and blend_enable for transparency, you have to do depth sorting manually.
what this means is you must turn off @automatic mode for all gl objects in the scene.
then you manually send out bangs to the objects, in the order you want them drawn, after the “erase” message, and before the gl.render draw bang.

in your case you would bang the videoplane first, then bang the text3d.

#167012
Dec 19, 2009 at 6:49am

Thanks for your advice, will try it out!
Grateful Hugo.

#167013

You must be logged in to reply to this topic.