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
Instanced Color on Standard Shader causes Visual Artifacts on Device #4188
Comments
Thank you Martin for filing this! Are you using the Graphics.DrawMeshInstanced api (or something similar) to render the backplates? Or, how are you passing in the instanced color? |
Nothing special, backplate is part of the scene. Only checked the checkbox in the material. Then the interactable Theme changes the color based on button state using materialBlock
Get Outlook for Android<https://aka.ms/ghei36>
…________________________________
From: Cameron <notifications@github.com>
Sent: Monday, May 6, 2019 1:37:05 PM
To: Microsoft/MixedRealityToolkit-Unity
Cc: Martin Grman; Author
Subject: Re: [Microsoft/MixedRealityToolkit-Unity] Instanced Color on Standard Shader causes Visual Artifacts on Device (#4188)
Thank you Martin for filing this! Are you using the Graphics.DrawMeshInstanced api (or something similar) to render the backplates? Or, how are you passing in the instanced color?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMicrosoft%2FMixedRealityToolkit-Unity%2Fissues%2F4188%23issuecomment-489767225&data=02%7C01%7C%7C9a15d14ed81b4d04868208d6d2629ac7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636927718271728186&sdata=njwlr0FBm8cmOcQmOYh80qINa4dzT%2Fx%2BzCUk99%2B2B4o%3D&reserved=0>, or mute the thread<https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABOBMJMIIMISNKYLOMP7D43PUCJHDANCNFSM4HLDBVVQ&data=02%7C01%7C%7C9a15d14ed81b4d04868208d6d2629ac7%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636927718271738197&sdata=7Gt4CPXcyfl3Oh7dAQxtcXRWGQtmYP%2BE4yJ8Y9NQrq4%3D&reserved=0>.
|
Ah okay! When the “instanced color” checkbox is checked the shader assumes a buffer of instanced color properties exists. If one doesn’t exist (which one will not unless explicitly set) then it is probably reaching into uninitialized, or neighboring, memory hence the flickering colors. I’m hoping to open source an example of using this feature soon, but I can send you the example early if you would like? |
I think this is a bug we may have seen earlier Cameron whereby during initialization the material property is accessed causing a new instance to be created when that shouldn't be the case because the InteractableShaderTheme should be setting values via materialblocks |
I was able to get more context on this, this has already been addressed with #4049 |
Добрый день. У меня возникла та же проблема с мерцанием после установки GPU Instance на материале. Хотя скрипт стоит уже исправленный. Я делаю меню с компонентом Scrollig Objects, скрипт вешает на префаб меню , компонент MaterialInstance. И возникает ошибкаArgumentException: Could not find MaterialProperty: '_InstancedColor', Num properties: 96
|
And further . Of course, I'm not very good at shaders, but as far as I understand, the UNITY_INSTANCING_BUFFER_START (Props) block should be implemented in the shader. The standard shader has this block, but it does not implement the _InstancedColor property (there is only _Color). |
Hi @Rinatsin, that you for reporting this. You are correct the MRTK/Standard shader's instanced color property is named Do you know where the exception you posted above is coming from, or can you post the whole call stack? If it's coming from MRTK code it should be easy enough to change the FindProperty call from |
Thank you, Cameron. I corrected the name of the property in the file to _Color, since you say that it should be. |
Describe the bug
Turning on Instanced Color for back plates of the pressable buttons, to batch them, causes visual artefacts on device. Color flickers as the cursor moves over the buttons. Tested with PressableButtonPlated prefab.
To reproduce
Steps to reproduce the behavior:
Expected behavior
No visual artifacts, same as in Editor.
Screenshots
If applicable, add screenshots to help explain your problem.
Your Setup (please complete the following information)
Target Platform (please complete the following information)
The text was updated successfully, but these errors were encountered: