You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem or limitation you are having in your project
Users who write shaders that right to POSITION need to be aware of whether they are using opengl or Vulkan since opengl uses 1 to -1 z range clip space while Vulkan is 1 to 0. In both cases the near value is 1, but the far value differs.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
We would add a a new built in called CLIP_SPACE_FAR which would always be -1 in the compatibility renderer and 0 in the RD renderers. This will allow users to write shaders that are portable between the backends
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
This could easily be implemented with our built in system by always replacing CLIP_SPACE_FAR with the necessary value. This can be done with no performance cost and in only one line of code per renderer, so the maintenance burden is minimal
If this enhancement will not be used often, can it be worked around with a few lines of script?
The current work around is to check the value of OUTPUT_IS_SRGB and then change the far value manually. Not only is that cumbersome, but it requires users to have prior knowledge about the internals of our rendering architecture.
Is there a reason why this should be core and not an add-on in the asset library?
It can't be an addon as it is a core feature.
The text was updated successfully, but these errors were encountered:
What about the clip near plane? Not sure currently if that was also affected
The near plane is always 1, regardless of the backend! I initially included both, and it could make sense to define a CLIP_SPACE_NEAR, but its technically not necessary
Describe the project you are working on
Godot
Describe the problem or limitation you are having in your project
Users who write shaders that right to
POSITION
need to be aware of whether they are using opengl or Vulkan since opengl uses 1 to -1 z range clip space while Vulkan is 1 to 0. In both cases the near value is 1, but the far value differs.This was originally proposed by Khasehemwy in godotengine/godot#90443 (comment)
Describe the feature / enhancement and how it helps to overcome the problem or limitation
We would add a a new built in called
CLIP_SPACE_FAR
which would always be -1 in the compatibility renderer and 0 in the RD renderers. This will allow users to write shaders that are portable between the backendsDescribe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
This could easily be implemented with our built in system by always replacing
CLIP_SPACE_FAR
with the necessary value. This can be done with no performance cost and in only one line of code per renderer, so the maintenance burden is minimalIf this enhancement will not be used often, can it be worked around with a few lines of script?
The current work around is to check the value of
OUTPUT_IS_SRGB
and then change the far value manually. Not only is that cumbersome, but it requires users to have prior knowledge about the internals of our rendering architecture.Is there a reason why this should be core and not an add-on in the asset library?
It can't be an addon as it is a core feature.
The text was updated successfully, but these errors were encountered: