0 registered members (),
1,397
guests, and 7
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Unbelievably dumb noobie question about TRANSLUCENT
#350787
12/19/10 03:14
12/19/10 03:14
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
OP
Expert
|
OP
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Cant believe Im posting this, but Im haveing a mental-blank day.
I have a model... closed single mesh, UV-skinned, single 24bit skin, no shaders, and whatever material A7 auto-selected for a model. The MDL7 files just have (embedded) texture enabled, no materials or effects in the file itself. Entity is currently ent_create'd and is not running any actions.
When I load up the model without using TRANSLUCENT, it looks fine, excellent. If I set on the TRANSLUCENT flag, is goes transparent. Cool. If I crank alpha down to zero, it fades away. Also cool. But when I crank alpha up to 100 or above, it gets solid ... almost ?!?
It looks like all the normals are flipped or something. It just looks inside-out. Skin is definately 24-bit, NO alpha channel. And normals I assume are OK, because model appears fine when there is TRANSLUCENT is off. The warpage is also occuring while semi-transparent, but its hard to notice...
I KNOW Ive come across this before, and it isnt a model-issue Im certain.
What insanely stupid thing am I overlooking here?
Thanks guys...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Unbelievably dumb noobie question about TRANSLUCENT
[Re: EvilSOB]
#350788
12/19/10 03:21
12/19/10 03:21
|
Joined: Dec 2008
Posts: 271
Saturnus
Member
|
Member
Joined: Dec 2008
Posts: 271
|
Probably this is what you're looking for: A logical consequence of translucent or alpha channel transparent objects is that you can see other objects through them. This sounds trivial, but means that transparent or translucent entities must be rendered after all opaque entities (see rendering), and must not write into the 3D card's Z buffer. Thus their depth-sorting is not pixel-accurate, but only object-accurate. They won't hide other polygons or other parts of the same object. This can cause visible sorting errors on the screen when triangles of transparent models intersect or overlap. The errors are normally hardly noticeable, but sometimes very obvious - expecially when the alpha channel is almost opaque. You can read the full explanation here: http://www.conitec.net/beta/wed_entities.htm#transparency
|
|
|
Re: Unbelievably dumb noobie question about TRANSLUCENT
[Re: Saturnus]
#350789
12/19/10 04:18
12/19/10 04:18
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
OP
Expert
|
OP
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Yes Saturnus, I believe so to.
Im looking for suggestions, workarounds etc.
I seem to remember there was a fairly simple 'fix' for it... But that was two years ago....
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Unbelievably dumb noobie question about TRANSLUCENT
[Re: EvilSOB]
#350790
12/19/10 04:21
12/19/10 04:21
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
Taken from the wiki:
material mat_alphatest
{
effect =
"
technique alpha_test
{
pass p0
{
zWriteEnable = true;
alphaTestEnable = true;
alphaBlendEnable = false;
}
}
";
}
action apply_alphatest_material
{
my.material = mat_alphatest;
}
Convert it to lite-C, should help.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: Unbelievably dumb noobie question about TRANSLUCENT
[Re: Superku]
#350812
12/19/10 12:57
12/19/10 12:57
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
OP
Expert
|
OP
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Hmmm.
Good looking answer, and I may use this one if it doesnt bog the system down running on 40,000+ entities (within the camera fustrum) at once....
But I still feel there was some other way... I think it was before I had commercial, so its unlikely it was shader-based...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Re: Unbelievably dumb noobie question about TRANSLUCENT
[Re: EvilSOB]
#350816
12/19/10 13:15
12/19/10 13:15
|
Joined: Sep 2003
Posts: 6,861 Kiel (Germany)
Superku
Senior Expert
|
Senior Expert
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
|
It's a FFP, you don't need shaders. There is no other way (?), that's how translucent entities behave. Just reset(my,TRANSLUCENT); when its alpha is 100.
Btw. you do not want to have 40,000+ Entities.
Last edited by Superku; 12/19/10 13:16.
"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual Check out my new game: Pogostuck: Rage With Your Friends
|
|
|
Re: Unbelievably dumb noobie question about TRANSLUCENT
[Re: Superku]
#350822
12/19/10 13:53
12/19/10 13:53
|
Joined: May 2005
Posts: 2,713 Lübeck
Slin
Expert
|
Expert
Joined: May 2005
Posts: 2,713
Lübeck
|
Alpha testing doesn´t allow semi transparency, and that is what you want. Ao Superkus first post won´t help you. The only fix would be a model without faces on the backside facing the cam. Alternatively you could sort the faces, but that means quite a lot of work and is really slow with many polygons. Superku, While the code is no shader code, the graphics driver will make it a shader as otherwize modern hardware wouldn´t be able to draw it. As there is no fixed function pipeline anymore for a couple of years, only shaders .
|
|
|
Re: Unbelievably dumb noobie question about TRANSLUCENT
[Re: Slin]
#350836
12/19/10 16:02
12/19/10 16:02
|
Joined: Feb 2008
Posts: 3,232 Australia
EvilSOB
OP
Expert
|
OP
Expert
Joined: Feb 2008
Posts: 3,232
Australia
|
Bugger, BUT...
While Superku's code wont work AS IS, is there any FF-pipe backface-culling possible?
Cause if I understand you rightly, because the graphic-driver is creating/compiling the shader, doesnt that mean the FF-pipeline-like shader will run on lite-c free? (avoiding shaders is pretty low-priority, but would be nice)
Cause if worst comes to worst, I can use the FFpipe backface-culling on just one of my models, and the other (potentially) 40,000+ would survive with the backface-ugliness left in cause it will all blur together... (40k is an expected maximum, 10-15k is 'normal'...)
FYI: This is for a TOOL, not a game, so FPS isnt too critical... So keeping above 15fps is probably acceptable...
"There is no fate but what WE make." - CEO Cyberdyne Systems Corp. A8.30.5 Commercial
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|