#Unity shader error
1 messages · Page 1 of 1 (latest)
Sounds like a syntax error in the shader code
Go check the line that it points to
it points to line 26
@warped gull any help please?
Share the whole !code properly.
📃 Large Code Blocks
Use links to services like:
https://paste.mod.gg/, https://hastebin.skyra.pw/, https://paste.ofcode.org/, https://paste.myst.rs/
📃 Inline Code
Surround code with three backquotes. Not quotation marks.
To format as C#, add cs to the first line:
```cs
// Your code here
```
Add a comment with a line number if there is an error message.
{
HLSLINCLUDE
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.universal/Shaders/PostProcessing/Common.hlsl"
TEXTURE2D(_MainTex);
SAMPLER(sampler_MainTex);
half _Cutoff;
half4 FragmentSimple(Varyings input) : SV_Target
{
return 1;
}
half4 FragmentAlphaTest(Varyings input) : SV_Target
{
half4 c = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv);
clip(c.a - _Cutoff);
return 1;
}
ENDHLSL
SubShader
{
Tags { "RenderPipeline" = "UniversalPipeline" }
Cull Off
ZWrite Off
ZTest LEqual
Lighting Off
Pass
{
Name "Opaque"
HLSLPROGRAM
#pragma multi_compile_instancing
#pragma vertex Vert
#pragma fragment FragmentSimple
ENDHLSL
}
Pass
{
Name "Transparent"
HLSLPROGRAM
#pragma multi_compile_instancing
#pragma vertex Vert
#pragma fragment FragmentAlphaTest
ENDHLSL
}
}
}
This isn't my code though
I can still see that 1-5 lines are missing
Comments from above saying the creator yes.
The full script is here:
https://paste.ofcode.org/MN53bxFuX6MrLGBBqMJLu7
What render pipeline and version was this shader made for? Where did you get it from?
Here's a thread of the issue you're having:
https://github.com/Arvtesh/UnityFx.Outline/issues/75
They have some walkarounds. I'd avoid using such an outdated asset though
Well, all free solutions available currently are junky. A custom one made by yourself is usually ideal, but we're not ideal.
I'm using a solution from this tutorial:
https://roystan.net/articles/outline-shader/(the provide the final implementation as a package)
Or to be precise this one: https://www.youtube.com/watch?v=LMqio9NsqmM&ab_channel=RobinSeibold
But I might have had to adjust it for unity 6. I don't remember for sure.
There might be better new solutions. I'm not up to date on the topic. I was mostly researching it around 2 years ago
Thank you