hi
i have some animatedscenenodes readin from several OBJ-files with solid textures inthere
defined over the OBJ-materialfiles etc...
now i want to make some of them semitransparent if they are in foreground.
what do i have to add to the scenenodes for this?
some hints out there?
thanx
max
how to make .obj semitransparent after readin?
-
- Posts: 15
- Joined: Fri Jun 03, 2011 9:35 am
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: how to make .obj semitransparent after readin?
Could you define "if they are in the foreground"?max6666north wrote:hi
i have some animatedscenenodes readin from several OBJ-files with solid textures inthere
defined over the OBJ-materialfiles etc...
now i want to make some of them semitransparent if they are in foreground.
what do i have to add to the scenenodes for this?
some hints out there?
thanx
max
Do you mean that you want objects to become see-through when they get close to the near-plane? If so, the easiest way to accomplish that IMO would be by using a shader which manipulates vertex color alpha depending on the vertex' position to the near-plane
If that's not the case, please explain what you want to do exactly
-
- Posts: 15
- Joined: Fri Jun 03, 2011 9:35 am
Re: how to make .obj semitransparent after readin?
[quote="Radikalizm"]
Could you define "if they are in the foreground"?
Do you mean that you want objects to become see-through when they get close to the near-plane? If so, the easiest way to accomplish that IMO would be by using a shader which manipulates vertex color alpha depending on the vertex' position to the near-plane
If that's not the case, please explain what you want to do exactly[/quote]
Hi
- yes see-through is the goal...
- finding which object shoud be semitransparent is not the problem.
- want to switch hole animatedmeshscenenotes
- I dont want to use shaders
tried something like this:
model=smgr->addAnimatedMeshSceneNode(smgr->getMesh("test.obj"));
model->getMaterial(0).DiffuseColor.setAlpha(120);
model->getMaterial(0).MaterialType=EMT_TRANSPARENT_VERTEX_ALPHA;
but wont work - shows only inverted hidden surfaces in solid...
thx
max
Could you define "if they are in the foreground"?
Do you mean that you want objects to become see-through when they get close to the near-plane? If so, the easiest way to accomplish that IMO would be by using a shader which manipulates vertex color alpha depending on the vertex' position to the near-plane
If that's not the case, please explain what you want to do exactly[/quote]
Hi
- yes see-through is the goal...
- finding which object shoud be semitransparent is not the problem.
- want to switch hole animatedmeshscenenotes
- I dont want to use shaders
tried something like this:
model=smgr->addAnimatedMeshSceneNode(smgr->getMesh("test.obj"));
model->getMaterial(0).DiffuseColor.setAlpha(120);
model->getMaterial(0).MaterialType=EMT_TRANSPARENT_VERTEX_ALPHA;
but wont work - shows only inverted hidden surfaces in solid...
thx
max
-
- Posts: 1215
- Joined: Tue Jan 09, 2007 7:03 pm
- Location: Leuven, Belgium
Re: how to make .obj semitransparent after readin?
Any particular reason why you really don't want to use shaders?
They're extremely useful for situations like these and from what I understand they could help you out perfectly in your case, but if you're targeting a platform with no programmable pipeline features (eg. OpenGL ES 1.x) I can understand
They're extremely useful for situations like these and from what I understand they could help you out perfectly in your case, but if you're targeting a platform with no programmable pipeline features (eg. OpenGL ES 1.x) I can understand
-
- Posts: 15
- Joined: Fri Jun 03, 2011 9:35 am
Re: how to make .obj semitransparent after readin?
[quote="Radikalizm"]Any particular reason why you really don't want to use shaders?
They're extremely useful for situations like these and from what I understand they could help you out perfectly in your case, but if you're targeting a platform with no programmable pipeline features (eg. OpenGL ES 1.x) I can understand[/quote]
... no shaders available
max
They're extremely useful for situations like these and from what I understand they could help you out perfectly in your case, but if you're targeting a platform with no programmable pipeline features (eg. OpenGL ES 1.x) I can understand[/quote]
... no shaders available
max
-
- Competition winner
- Posts: 1123
- Joined: Sun Jun 10, 2007 11:14 pm
Re: how to make .obj semitransparent after readin?
If the object has textures, you'll need to make a blending function after assigning the vertex alpha. Try:
This blends the vertex color and the texture.
Code: Select all
material.MaterialTypeParam = irr::video::pack_texureBlendFunc(irr::video::EBF_SRC_ALPHA, irr::video::EBF_ONE_MINUS_SRC_ALPHA, irr::video::EMFN_MODULATE_1X, irr::video::EAS_TEXTURE | irr::video::EAS_VERTEX_COLOR);