Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request]: Set Render priority #44

Closed
bluelightzero opened this issue May 21, 2024 · 13 comments
Closed

[Feature Request]: Set Render priority #44

bluelightzero opened this issue May 21, 2024 · 13 comments
Labels
enhancement New feature or request

Comments

@bluelightzero
Copy link

Feature description

My scene makes use of a post-processing quad.

This means that any debug draw geometry gets put through the same post processing.

Ideally I would not like it to affect any of the debug lines drawn. It darkens them too much making them less useful.

If I had control over the material of the debug lines, I would simply enable transparency and increase the render priority

image

  • Post process represented as yellow
  • Left quad representing debug draw material desired. (render priority increased and transparency enabled)
  • Right quad representing current debug draw material.

Implementation Ideas

A simple project setting to set these 2 properties would be all I need.

@bluelightzero bluelightzero added the enhancement New feature or request label May 21, 2024
@DmitriySalnikov
Copy link
Owner

DmitriySalnikov commented May 21, 2024

Which properties exactly do you want to change?

I also wonder if disabling the depth test helps? https://dd3d.dmitriysalnikov.ru/docs/1.4.1/classDebugDraw3DScopeConfig.html#a7743c67671bdce2e946991e0d66031f5

@bluelightzero
Copy link
Author

Which properties exactly do you want to change?

render priority increased and transparency enabled

I also wonder if disabling the depth test helps?

It draws over my post-process now, but also just draws over everything.

image

image

@DmitriySalnikov
Copy link
Owner

render priority increased and transparency enabled

I was referring to the names of the properties in the shaders. I have not found how to increase the priority.

I know how to enable transparency mode, but I don't really understand how to change the priority.

@bluelightzero
Copy link
Author

image

@DmitriySalnikov
Copy link
Owner

Thanks! I've never even paid attention to this priority property.
image

And transparency in the shader code is activated when ALPHA is reassigned.

I'm not sure if transparency needs to be activated separately, or is it enough to always activate it when the priority changes? Although I will probably add the option to select the mode (default, all opaque, all transparent) (do I just need to activate transparency or change it depending on the color? 🤔 ).

@bluelightzero
Copy link
Author

I found it just ignores priority unless it has something like transparency enabled.

This might be a bug in the engine, I don't know.

@bluelightzero
Copy link
Author

image

image

@DmitriySalnikov
Copy link
Owner

Well, according to the documentation, opaque should be sorted with opaque and transparent with transparent, but I only succeeded with transparent ones..

image

@DmitriySalnikov
Copy link
Owner

(here regenerate_geometry_meshes is used when clicking on END)

godot.windows.editor.dev.x86_64.mono_3LMiEoPwzm.1.1.1.1.1.mp4

I don't like the fact that transparent shapes are not sorted among themselves by distance to the camera :(

@bluelightzero
Copy link
Author

It may be impossible to sort a shape, such as this one:

image

https://www.khronos.org/opengl/wiki/Transparency_Sorting

@bluelightzero
Copy link
Author

Looks like the setting is working well. :)

Is this going in a build soon?

@DmitriySalnikov
Copy link
Owner

Test binaries will be here

@DmitriySalnikov
Copy link
Owner

https://www.khronos.org/opengl/wiki/Transparency_Sorting

I'm not sure, but it probably doesn't suit me, because I use MultiMesh, which are sorted once for all instances based on the node/mesh position (and the position of all of them is Vector3(0,0,0)...). Perhaps some combination of flags and shader code can fix this problem, but I did not succeed. If I understand correctly, then the best solution would be to use individual instances for each shape when using no_depth or transparent materials, which will decrease performance and require a lot of code edits.

Is the current renderer priority solution suitable for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants