I've used shadergraph for a while, but it's feeling limiting to me now, so I'd like to start learning how to write shaders myself instead of relying on shadergraph to write the code for me. Though I've searched for a while I can't find a single tutorial for making these shaders that don't already assume you know how sprite shaders work, so I've come here looking for help with finding one.
#Where to learn how to write sprite shaders?
1 messages · Page 1 of 1 (latest)
Well, there's not that much different to the sprite shaders compared to any other shader. So if you know how to write shaders in general, you should be fine. You can also look at the source code of the unity default sprite shader to see how it's different.
Is there anything specific about sprite shaders that you don't understand?
I can't figure out how to get the textures to apply like at all
1st is in game scene 2nd is material preview on a plane and 3rd is the shader itself
here it is in a gist https://gist.github.com/DarkTerraYT/0689dcca48e1c83019083712e674827c
Assuming the first screenshot is sprite renderer, then it's either:
- you assign the texture(sprite) in the renderer, but the shader doesn't use the same naming conventions for the albedo that the sprite renderer sets. So an empty white default texture is assigned to that property instead.
- you do name it properly, but don't assign it via the sprite renderer(but via a material), at which point the sprite renderer overrides it with whatever is assigned to it(which is probably nothing, so a white empty default texture is assigned instead).
Basically, it seems like an issue with misunderstanding the sprite renderer, rather the shader.
Looking at the main texture name, it seems to be the second case.
It's like you ignored my message entirely...
you do name it properly, but don't assign it via the sprite renderer(but via a material), at which point the sprite renderer overrides it with whatever is assigned to it(which is probably nothing, so a white empty default texture is assigned instead).
it is assigned
I meant like in the material itself
Take a screenshot of the sprite renderer
Take a screenshot of the Square sprite.
I mean the sprite asset, it's texture.
Because that's what your shader ends up sampling.