Is there an available tint shader for Unity?
I looked at the thread here and found you can;t use the tint effect in Unity. Is there not one available out of the box? I have a white png with a transparent background, and I would like to change its color depending on triggers.
-
-
sfernandez
Site Admin
- Posts: 3364
- Joined:
Re: Is there an available tint shader for Unity?
Hi, you can install the BrushShader and VideoEffect samples from our package to learn how to create your own shaders.
In the VideoEffect sample there is in fact a TintEffect, although I recommend you transform that into a BrushShader because it is more efficient and you don't need an Effect in your case, effects are better to modify a group of objects.
In the VideoEffect sample there is in fact a TintEffect, although I recommend you transform that into a BrushShader because it is more efficient and you don't need an Effect in your case, effects are better to modify a group of objects.
Re: Is there an available tint shader for Unity?
Note that in Unity, for now, only HLSL platforms (D3D11, D3D12) support custom shaders.
Re: Is there an available tint shader for Unity?
Are there any plans to include this in Noesis? Graying out images is incredibly common in game UIs, but you can't do this if there is any transparent background right now. Out of the box, you have to include multiple images in order to make images look disabled. I sadly don't know how to make a shader like this.
The tint effect won't work on Android?
The tint effect won't work on Android?
Re: Is there an available tint shader for Unity?
We don't plan to include this shader in the core, but it should be easy to create your own starting with our examples. For example, in C++ we have the following saturation shader that can be used for B&W effects (as sergio said, we recommend having a look at BrushShaders and VideoEffect samples included in the Unity package)Are there any plans to include this in Noesis? Graying out images is incredibly common in game UIs, but you can't do this if there is any transparent background right now. Out of the box, you have to include multiple images in order to make images look disabled. I sadly don't know how to make a shader like this.
Code: Select all
#include "HLSLHelpers.hlsli"
cbuffer Constants: register(b1)
{
float saturation;
}
float4 main(in In i): SV_TARGET
{
float4 c = GetInput(i);
return GetOpacity(i) * float4
(
c.r * (0.213f + 0.787f * saturation) + c.g * (0.715f - 0.715f * saturation) + c.b * (0.072f - 0.072f * saturation),
c.r * (0.213f - 0.213f * saturation) + c.g * (0.715f + 0.285f * saturation) + c.b * (0.072f - 0.072f * saturation),
c.r * (0.213f - 0.213f * saturation) + c.g * (0.715f - 0.715f * saturation) + c.b * (0.072f + 0.928 * saturation),
c.a
);
}
For now only renderers supporting HLSL (D3D11, D3D12, Xbox) will render custom effects. But we are working on supporting the rest of platforms.The tint effect won't work on Android?
Who is online
Users browsing this forum: No registered users and 2 guests