old skool - Wolfenstein
Moderator: Moderators
old skool - Wolfenstein
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.
A little known character, "the Mutant", displays all the correct views all the time.
- Attachments
-
- 2Deditor5_win.zip
- (45.88 KiB) Downloaded 879 times
"great expectations"
Getting closer.
You can hide the slide with fog, poorer lighting, and background objects.
You can hide the slide with fog, poorer lighting, and background objects.
- Attachments
-
- animSprite_2_win.zip
- (53.81 KiB) Downloaded 843 times
"great expectations"
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.
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.
- Attachments
-
- animSprite_4.zip
- (61.68 KiB) Downloaded 844 times
"great expectations"

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

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
- Attachments
-
- No-Sorting.zgeproj
- (1.67 KiB) Downloaded 747 times
To get it working on my ATI-card I had to change to the following in the fragment-shader:
It's a pain that the rules of shader compilation are different between vendors.
Code: Select all
if(pixel.a!=0.0f)gl_FragColor = texture2D(tex1, gl_TexCoord[0].xy);

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

@ 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
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.
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.
- Attachments
-
- EDITOR.gif (18.65 KiB) Viewed 17141 times
"great expectations"
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.
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.

Last edited by y offs et on Mon May 10, 2010 4:26 pm, edited 1 time in total.
"great expectations"
These variants works also:
Code: Select all
(pixel.a>0)
Code: Select all
(pixel.a!=0)
I kept poking away once in a while, and came up with the beginnings of an editor, for anyone interested.
- Attachments
-
- editor.zip
- windows
- (134.16 KiB) Downloaded 837 times
"great expectations"