Faking Sloped, Transparent Geometry

Ask about mapping, UDMF, using DoomBuilder/editor of choice, etc, here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Faking Sloped, Transparent Geometry

Postby RockstarRaccoon » Mon Apr 16, 2018 4:40 pm

So, after my feature request was denied on the fact that they'd have to rework the rendering process for it to work, I looked into a workaround for rendering geometry that is both sloped and translucent.

I managed to do it with pitched flat sprites with no physics presence, and invisible 3D floors for collision. In order to create the piece of geometry I desired (a 45 degree ceiling window to an alien greenhouse), I put the solid, yet completely unrendered 3D floor where I needed it to be, and made an actor which used the texture of the glass. I then carefully positioned the flatsprite actors directly over the 3D floor, so they'd be rendered where the 3D floor wouldn't.

The result is in the image. (Obviously there are some problems with my alignment, but that will be fixed through further tweaking)
Spoiler:


This is the code of the sprite things.
Code: Select allExpand view
ACTOR Abstract_FakeTexture {
   -SOLID
   +NOGRAVITY
   +NOBLOCKMAP
   +NOCLIP
   +NOTRIGGER
   +Flatsprite

   Radius 32 // I made it wide so it'd be easy to grab in 3D mode
   Height 8 // I made it short so I could put it close to a sky ceiling
}
ACTOR Tex_LabGlass : Abstract_FakeTexture 13668 {
   RenderStyle Translucent
   Alpha 0.2

   States {
      Spawn:
         T_LG A -1
         Loop
   }
}
ACTOR Tex_LabGlass_45 : Tex_LabGlass 13669 { // Specially suited for lining it up at a 45 degree angle.
//   Pitch 45
   YScale 1.4142 // This is the length of the hypotenuse of a right triangle where both sides are 1.
}
User avatar
RockstarRaccoon
Totally Babies
 
Joined: 31 Jul 2016

Re: Faking Sloped, Transparent Geometry

Postby Graf Zahl » Mon Apr 16, 2018 4:43 pm

Be aware that this cannot be properly sorted so it may glitch quite badly.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Faking Sloped, Transparent Geometry

Postby RockstarRaccoon » Mon Apr 16, 2018 4:48 pm

Graf Zahl wrote:Be aware that this cannot be properly sorted so it may glitch quite badly.

Really? Can I get more details? So far it's working fine where I used it, but yeah, I'm sure there's a problem here if someone tried to use it for something more complicated...

I was going to also use a similar method, along with MD3 models, for some complicated door, grass, and suspended-stair geometry...
User avatar
RockstarRaccoon
Totally Babies
 
Joined: 31 Jul 2016

Re: Faking Sloped, Transparent Geometry

Postby Graf Zahl » Mon Apr 16, 2018 5:05 pm

Same reason why translucent sloped 3D floors cannot be done: To render translucency correctly it needs to be properly sorted. And sprite sorting right now is a simple distance sort so any sprite coming near such a thing will inevitably produce some visual artifacts.
User avatar
Graf Zahl
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: Faking Sloped, Transparent Geometry

Postby RockstarRaccoon » Mon Apr 16, 2018 6:00 pm

Thanks for the info. Good to know!
User avatar
RockstarRaccoon
Totally Babies
 
Joined: 31 Jul 2016


Return to Mapping

Who is online

Users browsing this forum: No registered users and 2 guests