How can I expose the property of two sided in shader graph?
I’m trying to figure this out too
Did you guys figure it out? Dont really want to duplicate the shader just for that
In new version, I guess 2021.2+ you can enable “Allow Material Override” to expose these options, including cull mode, but in old versions I think there is no easy way or not possible at all. The only thing you can do is branch checking side, but it is not the same as cull mode. It might be possible to hack shader graph in some way, but it would require at least custom editor I guess.
Still no way to expose, double side, transparency or opaque, metalic or specular… i think old versions of shader graphs were better at least i could expose thoose parameter and din’t need to cretea the same material with one parameter diferent from the rest…
Why are you sowing disinformation? There is even LTS version with support for that. Also name what old version of SG supported exposing render face in inspector.
Allow material to override only work for parameters that’s are inside of the shader graph double side it’s on the shader config so this property does not work for that.
You can’t expose by shader graph i’m not saying it’s impossible to expose by code… don’t remember which shader graph had this options but indeed had it.
But whaterever it’s a lil headache to create by code but it’s not such complicated thing it’s bad we have to do this even after all those years… it’s like the minMaxAABB unity error which still on the engine for almost 8 years…
Cheers.
I am not sure I follow. This is shader graph I just made, isn’t that exactly what you need?
Obviously I don’t follow every single SG version, but I don’t remember anything like that in older versions.
[quote=“Qriva, post:8, topic: 823788”]
I am not sure I follow. This is shader graph I just made, isn’t that exactly what you need?
Obviously I don’t follow every single SG version, but I don’t remember anything like that in older versions.
[/quote]
Exactly the solution. They just changed the options. It used to have a two-sided checkbox. Now just as you show, select both.
Is it possible to set culling from the material property block?
I would like to have the same mesh rendered twice one with cull front and the second with cull back. One of them also has an offset property that I set using MaterialPropertyBlock.
I have tried to set _TransparentCullMode, _CullModeForward, _OpaqueCullMode and _CullMode but it did not set cull mode.
You would need to check the source. Assuming you are on URP it looks like there is _Cull property.
However one note, if you use material property block and you are on scriptable rendering pipeline then it breaks batcher, you need different instances of materials to make batcher work (unless it’s instancing).
It is HDRP and I do not care that much about batching those are custom meshes and usually there are no two identical meshes on the scene. And there is only a handful of game objects.
any updates?
Does the old way have an option for back face only?