Voxel things.

Moderator: GZDoom Developers

User avatar
ZZYZX
 
 
Posts: 1384
Joined: Sun Oct 14, 2012 1:43 am
Location: Ukraine
Contact:

Re: Voxel things.

Post by ZZYZX »

Outline is done here:
https://github.com/Warsow/glsl/blob/mas ... .vert.glsl
Specifically by this line:

Code: Select all

	Position += vec4(Normal * u_OutlineHeight, 0.0);
Which is essentially the variant where model is rendered twice, but one of the passes with vertices pushed a bit out, in another color and with back faces only.
This is essentially noticeable in frames/positions like this: https://i.imgur.com/Z9OMLp2.png (screenshot from the vid)

LOL'd at Graf's "cannot be achieved purely by models". If I make a second mesh (with larger boundaries) manually, then flip it's faces and use it with an engine that actually displays only front face (not like GZDoom which always displays both) then it will be done purely with models. Magic, right?

I wouldn't care much, but this misbelief might lead to erroneous [No]'s in the future :roll:
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49056
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Voxel things.

Post by Graf Zahl »

No, you cannot do it *purely* with models. You always need some hackery and need to be extremely careful about avoiding glitches.
There's also the issue of maintainability. Not everything that gets a 'no' does so purely because it's not doable. Sometimes it also gets done because nobody wants to care about the code later.
User avatar
GFD
Posts: 347
Joined: Mon May 31, 2010 7:42 pm
Preferred Pronouns: He/Him
Location: Canada
Contact:

Re: Voxel things.

Post by GFD »

I've used this overlapping effect on voxel models in the software renderer before to accomplish some really cool effects. Notable were some 3D fire effects, using three+ overlapping voxel models with different colours. This isn't something that could be accomplished with outline shaders. I haven't yet gotten far enough with the project to warrant a feature suggestion though, and then suddenly this one came and went when I wasn't looking. Gez's suggestion to allow inverted voxel faces would let this work with specially-crafted convex shapes in both software and hardware renderers, so I'm not sure why it isn't a viable option.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”