Z-Offsets for Voxels

These are not rejected - but are not considered highly important right now.

Moderator: GZDoom Developers

Post Reply
User avatar
hfc2x
Posts: 646
Joined: Mon Aug 17, 2009 11:37 am
Location: Chule

Z-Offsets for Voxels

Post by hfc2x »

Just like 3D Models have a ZOffset property, Voxels also need one. It's not like we are gonna open Slab6 to modify a Voxel every time we want to change the offsets, so shifting the ofsets via a property would be a good idea.
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: Z-Offsets for Voxels

Post by Graf Zahl »

This needs some input how to implement in the refactored software renderer. The rest should be simple.
dpJudas
 
 
Posts: 3036
Joined: Sat May 28, 2016 1:01 pm

Re: Z-Offsets for Voxels

Post by dpJudas »

If we are talking about adding a value to the Z position of the voxel, then I think this is done in RenderVoxel::Project (r_voxel.cpp) by adding something to the 'pos' variable before it is stored in the vis object.

There's a line in there already saying this: "pos.Z -= thing->Floorclip". I'm assuming this is just another line added right after that.

Is this offset in world space or model space? If it needs to be in model space, then voxels already got a Pivot member. Implementing it in model space is probably a question of finding the places where Pivot is accessed in that file and add the new offset to the variable it copies Pivot.Z to.
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: Z-Offsets for Voxels

Post by Graf Zahl »

It needs to be added to the pivot, but I do not want to touch this before the merge so it got moved to 'on hold'.
Post Reply

Return to “On Hold Suggestions”