old skool - Wolfenstein

Post screenshots, binaries and projectfiles of the projects you have made with ZGE that you want to share!

Moderator: Moderators

Post Reply
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

old skool - Wolfenstein

Post 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.
Attachments
2Deditor5_win.zip
(45.88 KiB) Downloaded 747 times
"great expectations"
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post by y offs et »

Getting closer.
You can hide the slide with fog, poorer lighting, and background objects.
Attachments
animSprite_2_win.zip
(53.81 KiB) Downloaded 717 times
"great expectations"
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

Cool :)

He looks quite evil. Movement and animation seems to work properly, nice work!
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post by y offs et »

Just shoot it. 8)
Attachments
Mutant_all_OS.zip
(288.95 KiB) Downloaded 717 times
"great expectations"
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post 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.
Attachments
animSprite_4.zip
(61.68 KiB) Downloaded 716 times
"great expectations"
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post 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
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post 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.
"great expectations"
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post 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
Attachments
No-Sorting.zgeproj
(1.67 KiB) Downloaded 620 times
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post 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.
User avatar
Kjell
Posts: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Post 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
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post 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.
Attachments
EDITOR.gif
EDITOR.gif (18.65 KiB) Viewed 15547 times
"great expectations"
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post 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. :?
Last edited by y offs et on Mon May 10, 2010 4:26 pm, edited 1 time in total.
"great expectations"
User avatar
VilleK
Site Admin
Posts: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Post by VilleK »

These variants works also:

Code: Select all

(pixel.a>0)

Code: Select all

(pixel.a!=0)
User avatar
y offs et
Posts: 418
Joined: Wed Apr 22, 2009 4:26 pm
Location: BC, Canada

Post by y offs et »

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 704 times
"great expectations"
Post Reply