#IN-35885 DOTS Material Property Overrides does not work.

1 messages · Page 1 of 1 (latest)

teal rose
glacial umbra
#

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.

teal rose
#

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

fair jasper
#

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

teal rose
#

yea i tried that too, but it seems there is no way to change color through script

#

in pure ecs*

fair jasper
#

wdym? after you attached component override you simply write to it's value

tidal elbow
#

If u confirmed it really doesn't work, I recommend u to submit bug report

#

@teal rose Btw are u using latest Unity .11?

teal rose
#

using 22.2.9f1, does it work on .11?

tidal elbow
#

Not sure. I haven tried it yet. 🤔

teal rose
#

ill test this on monday, see if it works in 11

fair jasper
#

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

teal rose
#

everything is set exactly as doc, but doesnt work, not sure where i did wrong. pics are at the top

fair jasper
#

when you test around inside shader graph

#

your preview shows this

#

idk what your input default color

teal rose
#

yes because default is black

fair jasper
#

but did you check?

#

everything else seems fine

teal rose
#

check what

fair jasper
#

if you change default color in shader

#

is preview matching

#

who knows

teal rose
#

i can change color in shader graph

#

or just change material varients in inspector

#

but change color in authoring did nothing

fair jasper
#

did you check result entity

#

does it have a component?

#

oh yeah

teal rose
fair jasper
#

looks like it does

teal rose
#

already posted

#

but yea the component is on it

fair jasper
#

hmm

#

try other instancing method

#

in property

teal rose
#

in property?

fair jasper
#

in shader graph property declaration

#

I mean

#

I remember I had similiar problem and something about not matching tutorial

#

maybe that's the case

teal rose
#

emm

fair jasper
#

but project where I did it was scrapped

#

because it was just for testing around

teal rose
#

what other options do i have

#

besides copying URPmaterialpropertybasecolor

fair jasper
#

nah, it should totally work for custom

#

I tested it in feb or march on my end

teal rose
#

emm

#

strange

#

maybe 11 should be fine, need to check this on monday

fair jasper
#

I tested on earlier version

#

doubt it's relevant

teal rose
#

would you mind make a working sample?

#

i cant figure out where the problem is

fair jasper
#

I do, I got other work. I just procrastinate atm 😅

teal rose
#

lol

fair jasper
#

just play around with property settings

teal rose
#

yea i ll check this later

teal rose
#

sadly 11 doesnt work neither on my side

#

do i miss any step?

fair jasper
#

I notice you are looking at prefab mode

#

this is GO rendering, not entity

teal rose
#

same at runtime

#

if you try this with urpbasecoloroverride it will also work in prefab mode

fair jasper
#

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
            });
        }
    }
teal rose
#

yea with material override asset it works but again

#

they way in doc doesnt work

fair jasper
#

well, it's preview

#

be ready that docs are not ready

#

😅

#

graphics is actually on of the least documented packages

teal rose
#

how do i mark this post as solved

fair jasper
#

just forget it, don't think it's important. and if it is - someone else will mark it

teal rose
tidal elbow
torpid cedar
#

also post bug number here when you have one

tidal elbow
teal rose
#

yea i submitted, but no feedback

#

so far

tawny walrus
#

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

teal rose
#

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?

tawny walrus
#

Hmm email usually comes pretty quick for me but usually ends up in spam

teal rose
#

lol yea they are in spam

#

no wonder i didnt see any

#

IN-35885

#

should be this

#

strange i cant check whats going on

tidal elbow
#

🤔 Login with ur account?

tawny walrus
#

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

teal rose
#

yea i use the same email but still no access

#

oh the email should match the one you use to receive feedback

teal rose
#

IN-35885 DOTS Material Property Overrides does not work.

tidal elbow
#

@old summit Is this the known issue at pre.65?

old summit
#

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.

teal rose
old summit
#

Sure, I should be here on Monday.

tidal elbow
teal rose
#

i dont have 13 yet,

#

i ll try that later

teal rose
#

ayyy it works in 13

#

finally

#

wait

#

false positive

#

🥲

#

no good on dino

#

oh wait its 12

#

let me port this to 13

teal rose
#

@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

old summit
#

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.

teal rose
#

do you mean this?

#

these are not visible in the scene

#

but its still there

#

and the hierarchy is intact i dont see seperated entities