Im Kira Suck it L
Im Kira Suck it L

Reputation: 11

Unity _MainTex property doesnt exsit when it clearly does

So Im trying to create an outline using shaders and materials, however, i cannot seem to get the image of the material reflecting the image on the sprite render, please help.

Like it keeps saying i dont have _MainTex but its quite clear i do, and ive tried everything, even setting it programmatically.

Image of the issue

edit - i was using shader graph, im new to shader graph, and the tourtial i follow said it was name must match.

I found out after much heart break it was the reference.

Upvotes: 0

Views: 9452

Answers (2)

user3114691
user3114691

Reputation: 31

You need set Reference is _MainTex Demo

Upvotes: 3

derHugo
derHugo

Reputation: 90600

What you show is only the display name for the Inspector .. the property name might differ from that! (See Writing Shaders) Important is the first name here:

Properties {
    // | this matters
    // |       | this is only for the Inspector!
    // V       V 
    _MainTex ("My Texture", 2D) = "white" { }
}

Upvotes: 2

Related Questions