Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (AndrewAMD, Imhotep), 567 guests, and 4 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
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 Offline OP
Expert
EvilSOB  Offline 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 Offline
Member
Saturnus  Offline
Member

Joined: Dec 2008
Posts: 271
Probably this is what you're looking for:
Originally Posted By: Manual
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 Offline OP
Expert
EvilSOB  Offline 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 Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Taken from the wiki:

Code:
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 Offline OP
Expert
EvilSOB  Offline 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 Offline
Senior Expert
Superku  Offline
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 Offline
Expert
Slin  Offline
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 laugh.

Re: Unbelievably dumb noobie question about TRANSLUCENT [Re: Slin] #350826
12/19/10 14:20
12/19/10 14:20
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Oh I did not know that, thanks.


"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: Slin] #350836
12/19/10 16:02
12/19/10 16:02
Joined: Feb 2008
Posts: 3,232
Australia
EvilSOB Offline OP
Expert
EvilSOB  Offline 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
Re: Unbelievably dumb noobie question about TRANSLUCENT [Re: EvilSOB] #351020
12/21/10 04:10
12/21/10 04:10
Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
Nowherebrain Offline
Serious User
Nowherebrain  Offline
Serious User

Joined: Jul 2005
Posts: 1,002
Trier, Deutschland
is there no way to do alpha blending and then alpha testing???...I'm no shader guru, but I think that would work.


Everybody Poops.
here are some tutorials I made.
http://www.acknexturk.com/blender/

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1