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

Async readback #2

Open
dkyeck opened this issue Mar 2, 2023 · 3 comments
Open

Async readback #2

dkyeck opened this issue Mar 2, 2023 · 3 comments

Comments

@dkyeck
Copy link

dkyeck commented Mar 2, 2023

_Writer.GetData looks pretty expensive. have you tried AsyncGPUReadback?

@przemyslawzaworski
Copy link
Owner

At one time I tried to use AsyncGPUReadback, but in my example it often caused blinking of mesh renderers. This solution was designed as a independent system that does not interfere with objects (no custom materials for objects etc.). So currently disabling selected mesh renderer component is the only way to disable draw call. Maybe better solutions exists to have a control over Draw Calls in Unity, opinions are welcomed.

@dkyeck
Copy link
Author

dkyeck commented Apr 3, 2023

sorry for my late reply.
do you still have that code? i have pretty large occluders and relatively small occludes. so scaling the aabbs and making it all less precise might be just fine?

@LoneDev6
Copy link

currently disabling selected mesh renderer component is the only way to disable draw call. Maybe better solutions exists to have a control over Draw Calls in Unity, opinions are welcomed.

image

private const ShadowCastingMode DEFAULT_SHADOWS = ShadowCastingMode.On;
// ....
meshRenderers[i][j].shadowCastingMode = (i == cellIndex) || (Vector4.Dot(elements[i], elements[i]) > 0.0f) ? DEFAULT_SHADOWS : ShadowCastingMode.ShadowsOnly;

I didn't notice any performance issue but disabling the MeshRenderer should be logically faster.

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

No branches or pull requests

3 participants