How to exactly control Fresnel colours

Your feedback is very important to us. We are listening.

How to exactly control Fresnel colours

Postby Monobanda » Mon Jul 02, 2018 3:20 pm

Hello all,

Using ASE, I created a shader that uses the Fresnel node.
I want to achieve the effect of having different colours for the base of an object, and the rim. So for instance a cobalt blue sphere with a bright red rim as a result of Fresnel effect.

So far, this is what I've achieved:
Image

Unfortunately this setup appears to make the rim a "mix" from both colours. So Instead of red, it produces a fuchsia pink colour, like this:
Image

How can I make sure I can have total control over both colours?

Cheers and thanks!
Monobanda
 
Posts: 7
Joined: Mon Jul 02, 2018 2:55 pm

Re: How to exactly control Fresnel colours

Postby Amplify_Borba » Mon Jul 02, 2018 3:55 pm

Hello, thank you for getting in touch!

Unfortunately, the images seem to be broken, could you please try uploading them to a free image service such as imgur, and share a few additional details regarding the effect you want to create?

Do you want the rim coloring to disregard the base color from the object?

If so, you could consider using the Fresnel's output as the alpha of a Lerp between two colors, for example.

Image

Thanks!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: How to exactly control Fresnel colours

Postby Monobanda » Wed Jul 04, 2018 9:25 am

Hi, thank you for answering.

My images were already uploaded on Imgur, kind of lame that they don't show...
But anyway, the problem is fixed, thanks to your setup.
Great job! Thank you!
Monobanda
 
Posts: 7
Joined: Mon Jul 02, 2018 2:55 pm

Re: How to exactly control Fresnel colours

Postby Monobanda » Wed Jul 04, 2018 10:27 am

Whoops - too soon. Turns out it didn't completely solve the problem. Some colours still don't display as desired.

Take a look at the two images... (also if for some reason the images are broken again - just right-click and open them in a new tab, works for me!)
Image
Image

See how the picked colours in the Inspector don't match up with the colours in my Scene (mostly the rim colour)?

Not sure what I've done wrong... Also I sometimes use the Saturate node when I have a feeling the colours get out of hand, but whether I plug it in or not, this time it doesn't change anything.

Any ideas?

EDIT: I don't use any lighting in my Scene other than the default environmental lighting.
Monobanda
 
Posts: 7
Joined: Mon Jul 02, 2018 2:55 pm

Re: How to exactly control Fresnel colours

Postby Amplify_Borba » Wed Jul 04, 2018 12:02 pm

The values might need some further tweaking in order to accommodate to different situations, please refer to the example setup below:

Image

I've connected the node setup to the Emission, since it controls the colour and intensity of light emitted from the surface regardless of the lighting conditions, in order to preserve the colors.

Adding the Saturate node and a Round node to the Fresnel's output can also ensure that the values remain at either 0 or 1, so that the Mask passed into the Lerp Alpha has no values in-between, which would cause the colors to blend.

Please let me know if this helps, thanks!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: How to exactly control Fresnel colours

Postby Monobanda » Wed Jul 04, 2018 12:22 pm

That seems to do the trick! Thank you.
Monobanda
 
Posts: 7
Joined: Mon Jul 02, 2018 2:55 pm

Re: How to exactly control Fresnel colours

Postby Amplify_Borba » Wed Jul 04, 2018 1:06 pm

Glad to be of assistance!

Have you had the chance to rate and review Amplify Shader Editor? It would be awesome if you could share your experience with the Unity community, the Unity Asset Store thrives on user interaction and direct feedback.
Every bit helps, your feedback is extremely valuable to us!

Feel free to get back in touch if you have further issues or questions, thanks!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests