Boolean Property supported in Material Override? (Use float property in shader instead of boolean)

Hey guys
I have a question/problem regarding Material Overrides and I am not sure if this is supposed to be working or not:

Edit: URP, Entities Graphics 1.0.0-pre.15, Unity Version 2022.2.1f1.112.6257

I am looking into shaders and tried to create a simple “Selected”-Shader:

I created a material override for the 3 parameters.


If I change the towercolor, it works in scene and game view
If I change the towerselected flag, it only works in scene view…

Are boolean Properties not supported or am I doing something wrong?
If I set Towerselected to 1 and run it, it is applied correctly in the Entities Hierarchy window and updates the scene window, but not in the game…
But the overriden towercolor property is applied correctly to the game…

Left side is the game running, right side is the scene view (both with towerselected = 1):

Thanks for your time :slight_smile:

Boolean properties are treated as floats, so you’ll have to pass a float and then do a true/false check for say <0.5f.

Thanks for your reply Charles, the override value is set to 1 in the Entities Hierarchy window.
8706897--1176015--upload_2023-1-5_11-52-39.png

You led me on the right track, it works if I use a float instead of a boolean property in the shader.

3 Likes