Has anyone ever managed to use Toony Colors Pro 2 to create a decal shader?
I’m having a bit of trouble doing so. I know decals are not really an intended use of the package. My reasoning for wanting it is that I want to basically reuse some TCP shader effects that took me a while to put together, as decals. Also, it looks like it should be possible with the right options and a bit of code injection, but so far I’ve just created some weird depth monstrosities that don’t really work as projections.
You need to also add the vertex displacement code into the outline’s vertex function (called “vertex_outline” here).
So the code block you added in vertex_surface would also appear there:
(I haven’t tested, I don’t know if it’ll work out of the box or if you’ll need to also declare the properties for the outline code too ; but that’s the gist of it)
If you mean decals as in URP’s decal system, then indeed it is not made to do that out of the box.
Probably with code injection you could modify the shader to make it behave however you want, for that you’ll need to analyze Unity’s provided decal shaders (last time I checked those shaders were ShaderGraph only though, and a pain to convert into a hand-written text shader).
Another alternative would be to make old school decals, i.e. a regular transparent shader (using either alpha blending or alpha testing) on a planar mesh that you then place in your environment. But that gets you planar-only poster-like decals, not projected ones that can adapt to any kind of geometry…
How can I fade a hybrid shader 2 material through a script? Setting the rendering mode to fade, and then setting the material.color alpha to 0 doesn’t seem to work:
Color color = meshRenderer.material.color;
color.a = alpha;
meshRenderer.material.color = color;```
However, if I manually change the rendering mode from Opaque to Fade in the inspector window, then things work as expected. I'm assuming some other values are being altered in the shader when the rendering mode drop-down is used in the material inspector.
The _RenderingMode variable is actually only used by the inspector; when you modify it, a lot of various related properties are changed on the material.
You can see all that in the MaterialInspector_Hybrid.cs script, in the SetRenderingMode function: it changes the blending, depth write, render queue, keywords and tags.
Hi all. We have some problems with URP and Unity 6000.0.5f1 with Toony Colors Pro 2 which was working before Unity 6. Below is the error we are getting and Hybrid Shader is failed to compile.
I have changed the project to linear space and spent lots of details to change but all I got was seeing the material but flickers sometimes
What might be the problem?
Thanks
I couldn’t reproduce the issue on my end, not sure what is happening.
However it looks like the error comes from a Unity include file, and searching about it I found this issue:
Looks like it’s fixed in Unity 6000.0.9, which isn’t available yet as far as I can tell. With roughly one new version every week, it should be available within two or three weeks maybe?
Is it possible to modify the Hybrid Shader 2 and add/edit properties to it?
Reason being, i generated a shader to use with a large number of objects, with the only thing added being the outline. However, the FPS takes a severe hit, even with GPU Instancing on. But, if i use the Hybrid Shader 2, the FPS is way better.
I need to modify the Hybrid shader to enable GPU Instancing on the main texture so i can alter each objects texture seperately. I tried to add Hybrid Shader to the Shader Generator but kept getting an error “Object reference not set to an instance of an object”. If i change any coding on the Hybrid Shader, it ends up breaking the shader until i revert back.
Unfortunately no, the Hybrid Shader 2 was written by hand and thus cannot be modified through the Shader Generator 2.
I plan to change that eventually to harmonize things, but it won’t come soon.
You can still edit the Hybrid Shader 2 manually though, the documentation about adding GPU instancing support on shaders is fairly good although it’ll be easier if you already know how to write shaders.
I keep ending up with lots of flickering in shaders from the Shader Gen 2 in Unity 6 URP. It happened to me last week when I tried to implement the smooth shadow technique, and this time I just made a Triplanar shader with tints on the Triplanar angles.
The one thing that comes to mind if Forward+: if you are using it, and the shaders aren’t compatible, it can cause that kind of flickering. So make sure Forward+ support is enabled in the Shader Generator 2.
If that’s not the issue, I’ll have to take a look when I have a chance - in that case please send me the shaders through email.
I am facing a problem while using TCP2 hybrid shader with outline on IOS. Actually its behaving weird, When the material GPU instancing is turned on… The Outlines of the objects behaves abnormally. They jitters and change the directions and this behavior is different on all the objects present in the scene. Can someone suggest me any fix. I almost have tried every option from Outline tab including pixel sizing, and outline normal source.