Translucent (3D) water

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
kgsws-CZ
Posts: 70
Joined: Sun Jul 19, 2009 9:50 pm

Translucent (3D) water

Post by kgsws-CZ »

I was playing with zdoom renderer, and i have figured out how to make translucent water effect.
I did few other things so it clips under/above water things correctly.
But it has many limitations, like problems when you use different water levels too close (water rendering will be correct, but sprite ordering not)
And, i guess, my code is one huge hack ... maybe ... but it is good as proof of concept ... or no?
Anyway, if you consider it usable, here is diff (with example wad): http://zdoom.ic.cz/zdoom/trwater.zip (diff made from revision 2288)
And here are some screenshots (and yes, all are made in software mode, no stacked sectors used):
Spoiler:
User avatar
InsanityBringer
Posts: 3386
Joined: Thu Jul 05, 2007 4:53 pm
Location: opening the forbidden box

Re: Translucent (3D) water

Post by InsanityBringer »

woah that's pretty cool

Closest the software renderer will likely get to rendering 3d floors. Anyone mind making a EXE for us non-programmer types?
User avatar
qwerqsar
Posts: 236
Joined: Sat Jun 02, 2007 10:06 am
Location: The beautiful Anahuac (A mexican kind of Midgard)

Re: Translucent (3D) water

Post by qwerqsar »

Nice! Would like to see a program for us, the ignorant masses :P
User avatar
Recurracy
Posts: 540
Joined: Fri Dec 19, 2008 12:11 pm

Re: Translucent (3D) water

Post by Recurracy »

That's awesome.
User avatar
StrikerMan780
Posts: 484
Joined: Tue Nov 29, 2005 2:15 pm
Graphics Processor: nVidia with Vulkan support

Re: Translucent (3D) water

Post by StrikerMan780 »

F'ing Sweet. I can see this becoming extremely useful for quite a few things I have in mind.

Now, if you could expand on this and get 3D Floors working in software, you'd be my hero.
kgsws-CZ
Posts: 70
Joined: Sun Jul 19, 2009 9:50 pm

Re: Translucent (3D) water

Post by kgsws-CZ »

3D floors are possible in software renderer, but right now i still don't fully understand it.
Even this water is not ideal, sprite ordering is messed because of 2 water levels (under and on) - that's why it does not support multiple translucent water levels on screen, and has few other bugs. (anyway, if you use one water level, it works great)
I am trying to get it better, its slow progress but it might be done. I don't know how much time i can spend on it.

And bad news, i can't give you EXE, i am compiling it under linux.
User avatar
InsanityBringer
Posts: 3386
Joined: Thu Jul 05, 2007 4:53 pm
Location: opening the forbidden box

Re: Translucent (3D) water

Post by InsanityBringer »

kgsws-CZ wrote:And bad news, i can't give you EXE, i am compiling it under linux.
I do have a working config to build Zdoom, so I'll try using that.
User avatar
Siggi
Posts: 3288
Joined: Sun Oct 03, 2004 8:57 am
Preferred Pronouns: They/Them
Location: South Africa

Re: Translucent (3D) water

Post by Siggi »

I just got this working now, and I'm impressed. This is a really nice effect.

I'd upload an EXE for the rest of you, but I'm using Linux as well.
#zdoom wrote:23:55 <@Siggi> ok, that water test build is awesome
23:56 < InsanityBringer> and I should have a windows EXE for those who aren't programmers. Soon
23:56 <@Siggi> nice
User avatar
InsanityBringer
Posts: 3386
Joined: Thu Jul 05, 2007 4:53 pm
Location: opening the forbidden box

Re: Translucent (3D) water

Post by InsanityBringer »

http://basementnet.us/ryan/zdoomw3dflats.zip

it should work. Provide your own FMODex.dll
User avatar
phi108
Posts: 976
Joined: Sat Dec 01, 2007 6:28 pm

Re: Translucent (3D) water

Post by phi108 »

This is very cool. Great job!

I hope the code is acceptable for inclusion into ZDoom, or maybe it will provide the inspiration or insight for an official feature addition. And I hope those "side-affect" 3D floors somehow become official and effective, though I doubt they will be as good as GL 3D floors...
User avatar
randi
Site Admin
Posts: 7746
Joined: Wed Jul 09, 2003 10:30 pm

Re: Translucent (3D) water

Post by randi »

phi108 wrote:I hope the code is acceptable for inclusion into ZDoom
It would be better if it was compatible with GZDoom's 3D floors.
kgsws-CZ
Posts: 70
Joined: Sun Jul 19, 2009 9:50 pm

Re: Translucent (3D) water

Post by kgsws-CZ »

randy wrote:It would be better if it was compatible with GZDoom's 3D floors.
That is not so easy, i used transfer_heights because it already has some sprite clipping code assigned with it, and it allows to make only one fake floor.
My changes in renderer allows only one fake floor per real sector, and because of that, sprite ordering is a lot easier.

I have done more experiments (not included in diff) - zdoom can have full 3D floors support, but it will need totally new system of sprite sorting that will count with fake floors. I have no idea about this new algorithm.
I can make 3D floors rendering without correct sorting right now. It will show all 3D floors, but sprites and/or floors will be overdrawn in most cases.
And bad thing, i have problems with sloped fake floors - if you make sloped fake floor that is touching real floor, it is not drawn correctly - as you can see in my example wad, that sloped floor is not begining at real floor (take a closer look).
Anyway, i guess that sprite + fake floor sorting algorithm with slopes support will be even more complicated.
User avatar
StrikerMan780
Posts: 484
Joined: Tue Nov 29, 2005 2:15 pm
Graphics Processor: nVidia with Vulkan support

Re: Translucent (3D) water

Post by StrikerMan780 »

But hey, imagine what could be done if you managed to pull it off. Take your time.
Scuba Steve
Posts: 1059
Joined: Sat Mar 27, 2004 8:56 pm

Re: Translucent (3D) water

Post by Scuba Steve »

Translucent water CAN be done with the current renderer... but it's really half-assed. Through a combination of Stacked sectors, transfer heights and multiple sprites it can be done to a lame degree. The effect can be seen in the river and Office fountain in Urban Brawl... but, like you said, the downside is that it clips sprites at the water level... which can be fixed for static sprites by adding a duplicate on the underside of the portal.
Blzut3
 
 
Posts: 3144
Joined: Wed Nov 24, 2004 12:59 pm
Graphics Processor: ATI/AMD with Vulkan/Metal Support

Re: Translucent (3D) water

Post by Blzut3 »

kgsws-CZ wrote:I can make 3D floors rendering without correct sorting right now. It will show all 3D floors, but sprites and/or floors will be overdrawn in most cases.
And bad thing, i have problems with sloped fake floors - if you make sloped fake floor that is touching real floor, it is not drawn correctly - as you can see in my example wad, that sloped floor is not begining at real floor (take a closer look).
Anyway, i guess that sprite + fake floor sorting algorithm with slopes support will be even more complicated.
I'll take unsloped 3D floors only over no 3D floors at all. If the renderer at least attempts slopes all the better, but as I said, I would like to see something happen rather than nothing at all.

Return to “General”