#I'm stuck on shaders and materials

1 messages · Page 1 of 1 (latest)

willow sphinx
#

Hello, I'm a complete beginner with Unity. I'm trying to work on a project, but unfortunately, I'm stuck on shaders and materials. The problem isn't so much the code itself, but Unity's logic. If someone could come and help me in pm, I would be very grateful (I don't think I'm that far from figuring it out)

grave orchid
#

You've started a thread so why not discuss it here.
But you didn't really explain what you problem is, so maybe start with that ?

willow sphinx
#

I have cards that display normal images without any problems. When I apply a material with a shader, the image appears correctly, but it's misaligned and overlaps all the other elements (like the text). I'd like to understand why this happens and how to keep the image and shader properly aligned, without them overlapping everything else.

willow sphinx
grave orchid
#

Could you share screenshots of :
The correct rendering
The wrong one
The material inspector when it is not working properly.

willow sphinx
#

yep

#

the 2 firsts image is without Material (with/o hover and with hover), the screenshot 3 is with only 1 card drawn anda mat, the 4 is with 2 cards and the mat.

#

If I hover the card with the mat, the picture dispawn

#

And I have the impression that it covers all this material, but that nothing remains when I hover

grave orchid
#

Can you also share the inspector of the material itself ?

willow sphinx
grave orchid
#

Also, I see that you're a fellow 🥖 🇫🇷 dev.
I'm runnin a small French speaking discord about Unity, so if you feel like ranting in the spell of Molière I can send you an invite 🙂

grave orchid
# willow sphinx

Hum, could you also share a screenshot of the full shadergraph ?
If possible, with readable node names, if needed you can make the shadergraph window fullscreen with shift+space

willow sphinx
#

yeah why not !

grave orchid
#

What is the object type you're applying the material to ?
A mesh renderer ? Sprite renderer ?

willow sphinx
#

to a sprite renderer

#

i think

grave orchid
#

A look at the inspector of the card object would answer that 🙂
If you are assigning the material with this shader to a sprite renderer, the shadergraph target should be set to "sprite" type

willow sphinx
#

here ?

grave orchid
#

Yes !
But confirm first that the object is actually a sprite renderer, and that you are in Universal2D mode, that's what the Sprite Material type is for (first setting)

willow sphinx
#

I just did it! The material was unlit and I changed the setting to unlit sprite

grave orchid
#

Worked ?

willow sphinx