Page 1 of 1

old skool - Wolfenstein

Posted: Sun May 02, 2010 5:40 pm
by y offs et
This is a proof-of-concept that thru determination and blatant hackery, an old coder like me can figure out how to make this work.

A little known character, "the Mutant", displays all the correct views all the time.

Posted: Tue May 04, 2010 5:05 pm
by y offs et
Getting closer.
You can hide the slide with fog, poorer lighting, and background objects.

Posted: Tue May 04, 2010 6:06 pm
by VilleK
Cool :)

He looks quite evil. Movement and animation seems to work properly, nice work!

Posted: Fri May 07, 2010 2:52 am
by y offs et
Just shoot it. 8)

Posted: Sun May 09, 2010 3:15 pm
by y offs et
An observation @ ZGE depth sorting.
Shoot to activate mutant.
From current position observe how some bars are rendered in front of model.
If you move to observe models path by fence, you will see wall avoidance is set.
If you move to observe model perpendicular to fence during travel, the depth sorting is correct.

Posted: Sun May 09, 2010 4:05 pm
by Kjell
:)

The current depth sorting technique only takes the Model's position in consideration. So when you place Models within a vicinity of each other that is smaller then the "size" of meshes they render .. this can happen yes.

You're making things difficult for yourself though. If you just go with nearest neighbor filtering ( and 1-bit alpha maps ), you don't have to worry about opacity blending .. and won't need any sorting either.

K

Posted: Sun May 09, 2010 4:17 pm
by y offs et
If you just go with nearest neighbor filtering ( and 1-bit alpha maps ), you don't have to worry about opacity blending .. and won't need any sorting either.
Help! Ya lost me again.

Posted: Sun May 09, 2010 4:28 pm
by Kjell
:roll:

Attached is a example of two sprites that use a texture with a alpha channel ( 1-bit, so only black or white ) without any actual Depth-Sorting.

K

Posted: Sun May 09, 2010 5:18 pm
by VilleK
To get it working on my ATI-card I had to change to the following in the fragment-shader:

Code: Select all

  if(pixel.a!=0.0f)gl_FragColor = texture2D(tex1, gl_TexCoord[0].xy);
It's a pain that the rules of shader compilation are different between vendors.

Posted: Sun May 09, 2010 5:24 pm
by Kjell
:lol:

I actually hesitated for a second when writing that statement .. but figured ATI's compiler wouldn't be THAT picky*. Guess not :P

@ y_offs_et : You don't have to use a shader though, you can use the fixed-pipeline function glAlphaFunc as well.

*Does (pixel.a != 0.0) work without the "f" suffix though?

K

Posted: Sun May 09, 2010 6:44 pm
by y offs et
Strange... I got two colourful diamonds on a changing background without problem.
Now to look at the code....

Edit - let me rephrase that - it compiles without problem - editor opens all components OK... until I click App. .... When I get this message ... and the preview has no bitmap but still changing background.

Posted: Sun May 09, 2010 7:18 pm
by y offs et
Anyway, previous is cool.

Back to my original depth sorting... I think I've figured what is happening.
These textures are 64x64 , but the actual area used most of the time is 32 wide in the middle. I thought about cutting them down, now I will.

When the sprite turns to face the player, a portion of the sprite is thru the wall.

EDIT - Actually, that wasn't it, and cutting the textures produced more problems. I was mixing meshes and sprites. :?

Posted: Mon May 10, 2010 5:52 am
by VilleK
These variants works also:

Code: Select all

(pixel.a>0)

Code: Select all

(pixel.a!=0)

Posted: Sat May 22, 2010 5:24 pm
by y offs et
I kept poking away once in a while, and came up with the beginnings of an editor, for anyone interested.