I think it would be really useful if actors using voxel models could be translucent. This would allow Heretic and Hexen graphics to be voxelized in the manner of the current Doom voxelization project.
The simplest method I could think of would be "whole-model" translucency, as suggested by DavidPH: the voxel model would first be rendered onto a blank canvas, then translucency would be applied to that rendered graphic based on the actor's alpha, and that graphic would simply be rendered as a regular sprite.
Another way of rendering translucent actors would be to render each individual voxel as translucent depending on the actor's alpha property and the size of the actor. Larger actors which are not hollow would have lower alpha for each individual voxel than smaller actors which are not hollow, due to having more voxels in the middle.
Translucent Voxels
Moderator: GZDoom Developers
Re: Translucent Voxels
You don't really need to make a suggestion for an incomplete feature. Blending was already planned for voxels.
KVX throws out completely occluded voxels from the middle of the object, so all voxels are hollow.Spleen wrote:Larger actors which are not hollow would have lower alpha for each individual voxel than smaller actors which are not hollow, due to having more voxels in the middle.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Translucent Voxels
Hm...
This will definitely be something I won't be able to get working in GZDoom unless doing it in a very, very, very hacky fashion...
This will definitely be something I won't be able to get working in GZDoom unless doing it in a very, very, very hacky fashion...
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: Translucent Voxels
I imagine it will fall prey to similar issues as translucent models...
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Translucent Voxels
Precisely, considering that I treat voxels as models in the GL renderer.
- NeuralStunner
-
- Posts: 12328
- Joined: Tue Jul 21, 2009 12:04 pm
- Preferred Pronouns: No Preference
- Operating System Version (Optional): Windows 11
- Graphics Processor: nVidia with Vulkan support
- Location: capital N, capital S, no space
- Contact:
Re: Translucent Voxels
From the changelog, it sounds like ZDoom assembles voxels as sprites before drawing them. Can a similar method not be used in GL? Is that the sort of "hacky" you were thinking of?
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49223
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Translucent Voxels
Yes. There's just 2 small problems with it:
1. In GL it's a lot more costly than with a software buffer. Such context switches as needed here can really bring down performance, especially if you have to do them multiple times in the middle of a render pass.
2. I need to find a way to get the 2D boundaries of the object. so that copying it to the screenbuffer won't get too costly.
Considering that even opaque voxel models take far too much time to set up I doubt it's a feasible approach.
1. In GL it's a lot more costly than with a software buffer. Such context switches as needed here can really bring down performance, especially if you have to do them multiple times in the middle of a render pass.
2. I need to find a way to get the 2D boundaries of the object. so that copying it to the screenbuffer won't get too costly.
Considering that even opaque voxel models take far too much time to set up I doubt it's a feasible approach.