Refactor: GLSL: Cleanup Clip Space vs. NDC Space naming #105423
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#105423
Loading…
Reference in New Issue
No description provided.
Delete Branch "(deleted):fix#105070"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The list of things done:
ndc_
are changed tohs_
(short for homogeneous space) if they are coming from a projection matrix multiplication without division.ndc
and change them tohomogenous
if they are working with the homogeneous space.point_view_to_ndc
topoint_view_to_homogenous
.point_world_to_ndc
topoint_world_to_homogenous
.point_object_to_ndc
topoint_object_to_homogenous
.gl_Location
is kept in homogeneous space.Resolves #105070
Thanks for tackling this task! Seems all good.
There is just a few minor issues and some suggestions about better renaming.
@ -84,4 +84,4 @@
vec2 stippleStart1 = stipplePos1;
/* Geometry shader equivalent calculations. */
vec2 ss_pos[2];
This should become
ndc_pos
since it is the position after the division.@ -46,3 +46,3 @@
if (hairThicknessRes > 1) {
/* Calculate the thickness, thicktime, worldpos taken into account the outline. */
float outline_width = point_world_to_ndc(center_wpos).w * 1.25 * sizeViewportInv.y *
float outline_width = point_world_to_homogenous (center_wpos).w * 1.25 * sizeViewportInv.y *
Did you run
make format
? there is an extra blank space here that should have been fixed by clang format.@ -34,3 +34,2 @@
vec3 isect = ray_plane_intersection(ray_ori, ray_dir, gpDepthPlane);
vec4 ndc = point_world_to_ndc(isect);
gl_FragDepth = (ndc.z / ndc.w) * 0.5 + 0.5;
vec4 hs = point_world_to_homogenous(isect);
Rename to
hs_isect
.@ -1,4 +1,4 @@
#pragma BLENDER_REQUIRE(common_view_lib.glsl)
f#pragma BLENDER_REQUIRE(common_view_lib.glsl)
An extra "f" is present at the beginning of the line. Seems like it was committed by mistake.
@ -223,3 +223,1 @@
vec4 ndc_adj = point_world_to_ndc(wpos_adj);
vec4 ndc1 = point_world_to_ndc(wpos1);
vec4 ndc2 = point_world_to_ndc(wpos2);
vec4 hs_adj = point_world_to_hs(wpos_adj);
Rename to
hs_pos_adj
.@ -224,2 +223,2 @@
vec4 ndc1 = point_world_to_ndc(wpos1);
vec4 ndc2 = point_world_to_ndc(wpos2);
vec4 hs_adj = point_world_to_hs(wpos_adj);
vec4 hs1 = point_world_to_homogenous(wpos1);
Rename to
hs_pos1
andhs_pos2
.@fclem I did the changes asked, could you review it once ?
The patch looks good. But there are some merge conflicts on two files. You need to merge main to your branch
git merge main
and then push your updates.@fclem merge conflict resolved
The PR still contain the conflicts. You need to manually edit these to keep both your changes and the incoming changes. Also try to build with
WITH_GPU_SHADER_BUILDER
to test all shaders compile (see this and this).@ -29,11 +29,15 @@ void main()
GPU_INTEL_VERTEX_SHADER_WORKAROUND
vec3 world_pos = point_object_to_world(pos);
<<<<<<< HEAD
Here.
@ -82,6 +82,10 @@ void main()
vec3 world_pos0 = point_object_to_world(in_pos0);
vec3 world_pos1 = point_object_to_world(in_pos1);
<<<<<<< HEAD
Here
@ -0,0 +1,56 @@
# This is the CMakeCache file.
This file should not be part of the PR.
I believe you used
ccmake .
from within the source folder. This generates some files that should not be committed.@ -0,0 +1 @@
# This file is generated by cmake for dependency checking of the CMakeCache.txt file
Same here. this file should not be part of this PR.
ohhh i'll remove them manually then
@ -31,3 +31,4 @@
vec3 world_pos = point_object_to_world(pos);
gl_Position = point_world_to_homogenous(world_pos);
vec3 view_pos = point_world_to_view(world_pos);
gl_Position = point_view_to_ndc(view_pos);
You still need to fix the merge errors. This will not compile as
point_view_to_ndc
does not exist anymore.You only removed the merge tags, but you need to remove what was below the
<<<<<<< HEAD
and do the renaming of what was above>>>>>>> main
.@ -84,2 +84,4 @@
vec3 world_pos1 = point_object_to_world(in_pos1);
vec4 out_pos0 = point_world_to_homogenous(world_pos0);
vec4 out_pos1 = point_world_to_homogenous(world_pos1);
vec3 view_pos0 = point_world_to_view(world_pos0);
Same thing here.
@fclem @Jeroen-Bakker done the changes you asked for...
Most shaders don't compile anymore. on Mesa/AMD
Most shaders don't compile due to a redefinition.
You can enable
WITH_GPU_BUILDTIME_SHADER_BUILDER
to check them during compilation.Fix#105070 GLSL: Cleanup Clip Space vs. NDC Space namingto Refactor: GLSL: Cleanup Clip Space vs. NDC Space namingPull request closed