here is the official doc about how to override a custom urp shader property. However , it does not work with entity 1.0. Did I miss any step? https://docs.unity3d.com/Packages/com.unity.entities.graphics@1.0/manual/material-overrides-code.html
#IN-35885 DOTS Material Property Overrides does not work.
1 messages · Page 1 of 1 (latest)
I'm not very good in DOTS, but your doing the change in your baker, and the docs change it in SystemBase. AFAIK the baker bakes before the game runs, and SystemBase runs while the game is playing. I have no idea of the intricacies of the shader changes and when they are allowed to happen, but this is in my mind a huge difference in how you coded it and the way the docs sample did. So maybe try to stick to the sample and see if that part works for your dino.
what doc did is changing the color in dynamic, it should work with authoring
check URPMaterialPropertyBaseColor
its the default urp material overrides, which works fine on urp materials but not with custom shader
the problem is custom color overrides does not affect custom shader graph shader
which means there must be an extra step to bind the authoring and actual material property
which doc doesnt say
basicly did the same thing as this but custom one just doesnt work
I managed to make them work with ShaderGraph
I use MaterialOverride asset
to properly bake
but there is an annoying bug with conversion
which converts color to gamma space
and you need linear for entities graphics
so colors must be baked manually
yea i tried that too, but it seems there is no way to change color through script
in pure ecs*
wdym? after you attached component override you simply write to it's value
If u confirmed it really doesn't work, I recommend u to submit bug report
@teal rose Btw are u using latest Unity .11?
using 22.2.9f1, does it work on .11?
Not sure. I haven tried it yet. 🤔
ill test this on monday, see if it works in 11
it worked in 9 or even earlier for me
did you declare property in shader
as dots intanced?
could be wrong on naming part
but property must be checked as instanced
everything is set exactly as doc, but doesnt work, not sure where i did wrong. pics are at the top
does shader work though?
when you test around inside shader graph
your preview shows this
idk what your input default color
yes because default is black
check what
i can change color in shader graph
or just change material varients in inspector
but change color in authoring did nothing
looks like it does
in property?
in shader graph property declaration
I mean
I remember I had similiar problem and something about not matching tutorial
maybe that's the case
emm
I do, I got other work. I just procrastinate atm 😅
lol
just play around with property settings
yea i ll check this later
same at runtime
if you try this with urpbasecoloroverride it will also work in prefab mode
because built in override components override material even during authoring (go)
just tested - it works
public class CustomMatOverride : MonoBehaviour
{
public MaterialOverrideAsset asset;
}
public class CustomMatOverrideBaker : Baker<CustomMatOverride>
{
public override void Bake(CustomMatOverride authoring)
{
var color = (Color)authoring.asset.overrideList[0].value;
AddComponent(new CustomRendererColorVector4Override
{
Value = (Vector4)color.linear
});
}
}
well, it's preview
be ready that docs are not ready
😅
graphics is actually on of the least documented packages
how do i mark this post as solved
just forget it, don't think it's important. and if it is - someone else will mark it
thanks for the code, i literally stuck for 2 days just figuring out which class to use
You can submit a bug report for this. Technically it should also work
also post bug number here when you have one
Btw have u submit bug report for this issue?
useful to post a bug number here if you have it
so if a dev sees it they can go look it up rather than having to wait for QA to test it, try repo it then pass it onto correct team etc
sure, but i dont have any feedback email yet. should i report one more time?
btw is this the correct place to report a bug?
Hmm email usually comes pretty quick for me but usually ends up in spam
lol yea they are in spam
no wonder i didnt see any
IN-35885
should be this
strange i cant check whats going on

🤔 Login with ur account?
if i recall, you need to sign up with a new jira account that matches the email of your unity account and then you can see only your issues
yea i use the same email but still no access
oh the email should match the one you use to receive feedback
IN-35885 DOTS Material Property Overrides does not work.
@old summit Is this the known issue at pre.65?
I know that we are working on a fix to improve the behavior of overrides for Entities that are baked from GameObjects that have multiple Materials.
However, looking at the screenshots in this thread closely suggests that it might not be the same issue.
@teal rose If you ping me when you're here, I can try to troubleshoot the issue with you a bit if you want.
not with my working pc atm, maybe next monday if you are available
Sure, I should be here on Monday.
Are u still able to reproduce the issue at unity 2022.2.13?
ayyy it works in 13
finally
wait
false positive
🥲
no good on dino
oh wait its 12
let me port this to 13
@old summit have you tried custom material override on skinned mesh
i think when you have compute deform node in shader override will not work
Can you check with Entities Hierarchy whether there's a single entity or many entities?
There's a known issue where placing authoring GameObjects with MaterialProperty sometimes doesn't work properly because the GameObject is actually converted to multiple entities and the override component is only placed on the "main entity", which might not be the one that's actually rendering.
In your screenshot it says "velociraptor + 1 Entity", which suggests you might be hitting this known problem case.