Custom Shader issues

I’ve come over from years of experience in UDK mainly as an environment artist, modeler and some tech art to now using Unity at my new job and running into issues.

My most current one is I am working on some custom shaders and currently need something that will let me do diffuse, alpha, emissive and let me boost the emissive through the material properties so I can push the strength of it and try to blow the value out. (Think stadium lights at night when looking at them.)

I had it set up so it just multiplied a value and it worked but I want control over it with either a range or slider so I don’t have to have a ton of multiple copies of essentially the same shader.

Here is what I have so far.

My biggest issue is I can’t figure out the write code/context to set the _IllumPush to work with the line (o.Emission = c.rgb * (tex2D(_Illum, IN.uv_Illum).rgb * _IlumPush):wink:

I am sure it’s a quick fix and something stupid that I am forgetting or missing.

Any help is greatly appreciated.

Thanks for your help.

IllumPush comes in as a float, not a range.

The range is just a float - but it’s got an upper/lower limit of input in the inspector.

So

//range _IlumPush;

becomes

float _IlumPush;

(Sup, by the way. It’s Talon from PC :))

Ok so I fixed what Farfarer mentioned but how do i multiply that to the emissive. Currently this is my line

o.Emission = c.rgb * (tex2D(_Illum, IN.uv_Illum).rgb * _IlumPush;

but i know that is wrong because everything is still pink. YAY!!!

If that’s the exact code, you’ve got an extraneous open bracket in there.

Check the console for errors, btw. It’ll report any errors it happens upon when it tries to compile your shaders. It’s not the that useful at error reporting when it comes to shaders but it can help.

Yeah I missed 2 brackets in my code that was causing issues. Fixed them and boom it worked. Ahh simple things that get overlooked.

Thanks.

Now on to the next issue.