Hello guys, I need an Iridescence shader for my game. Does anyone can make one? I will pay for it. Regards, Carlos
The simple way would be to have a lookup texture for the Fresnel to do that. That would work on static surfaces. For something like a soap bubble it's a bit more complex though. Then you can manually create a lookup texture or actually generate one which is a bit more tricky: https://en.wikipedia.org/wiki/Thin-film_interference My opinion is still that Unity should offer this out of the box in the standard shader. The simple option to have a lookup texture for Fresnel allows for better approximations for things like metals and adds the option for the average artist to add iridescence. This also means that the Unity lighting system should actually respect the values in the g-buffer. Whether or not you want to create a PBR base, you should leave this part up to the shader. The shader should output the amount of diffuse and reflection in a PBR way and the lighting calculations should follow this as is. (Currently Unity also adds reflections to surfaces that output 0 reflection/specular in the g-buffer.)
I need this shader for fish, so it most be able to perform in dynamic objects that have animations. I don't have any knowledge about shaders, so I am offering to pay for someone to make the shader. Regards, Carlos
I stumbled across https://assetstore.unity.com/packages/vfx/shaders/iridescence-thin-film-42944 while searching for something similar, but I am not affiliated with the author and have not tested it. I have a character that has the "blue black" hair that appears relatively blue in light and almost pitch black out of it. I was looking for a shader to create that effect. This one appeared to be a bit more focused on appearing metallic.
Give this one a whirl. Code (CSharp): Shader "Toon/Iridescent" { Properties{ _Color("Main Color", Color) = (0.5,0.5,0.5,1) _MainTex("Base (RGB)", 2D) = "white" {} _Noise("Noise (RGB)", 2D) = "white" {} // noise texture _Ramp("Toon Ramp (RGB)", 2D) = "gray" {} _IrTex("Iridescence Ramp (RGB)", 2D) = "white" {} // color ramp _IrColor("Ir Color", Color) = (0.5,0.5,0.5,1)// extra iridescence tinting _Offset ("Iridescence Ramp Offset", Range (0, 1)) = 1 // offset of the color ramp _Brightness ("Iridescence Opacity", Range (0, 1)) = 1 // opacity of iridescence _WorldScale ("Noise Worldscale", Range (.002, 5)) = 1 // noise scale [Toggle(LM)] _LM("Use Lightmap UVS?", Float) = 0 // use lightmap uvs instead of normal ones } SubShader{ Tags{ "RenderType" = "Opaque" } LOD 200 CGPROGRAM #pragma surface surf ToonRamp #pragma shader_feature LM sampler2D _Ramp; // custom lighting function that uses a texture ramp based // on angle between light direction and normal #pragma lighting ToonRamp exclude_path:prepass inline half4 LightingToonRamp(SurfaceOutput s, half3 lightDir, half atten) { #ifndef USING_DIRECTIONAL_LIGHT lightDir = normalize(lightDir); #endif half d = dot(s.Normal, lightDir)*0.5 + 0.5; half3 ramp = tex2D(_Ramp, float2(d,d)).rgb; half4 c; c.rgb = s.Albedo * _LightColor0.rgb * ramp * (atten * 2); c.a = 0; return c; } sampler2D _MainTex; sampler2D _Noise; // noise sampler2D _IrTex; // color ramp float4 _Color; float4 _IrColor; // extra tinting float _Offset; // color ramp offset float _Brightness; // Iridescence opacity float _WorldScale; // noise scale struct Input { float2 uv_MainTex : TEXCOORD0; float2 uv2_Noise : TEXCOORD1; // lightmap uvs float3 viewDir; // view direction }; void surf(Input IN, inout SurfaceOutput o) { half f = 1 -dot(o.Normal, IN.viewDir) + _Offset; // fresnel half4 n = tex2D(_Noise, IN.uv_MainTex * _WorldScale); // noise based on the first uv set #if LM n = tex2D(_Noise, IN.uv2_Noise * _WorldScale); // noise based on the lightmap uv set #endif half4 c = tex2D(_MainTex, IN.uv_MainTex ) * _Color; half3 i = tex2D(_IrTex, float2(f,f)+ n).rgb * _IrColor; // iridescence effect o.Albedo = (c.rgb) + ((i * n) * _Brightness); // multiplied by original texture, with an opacity float o.Alpha = c.a; } ENDCG } Fallback "Diffuse" } Try it out with the color ramp. This shader is from https://twitter.com/minionsart and i believe their is a patreon page if you wish to donate.
Thank you LoungeKatt and Subliminum, Both reply are very helpful! I will check that shader from Subliminum and the asset store one. I appreciate very much your help in this matter. I will let you know how it goes. Regards, Carlos
Subliminum, I checked the shader Toon/Iridescent, but as the title says it the shader doesn't have any specular, and other properties, so it is not practical for a realistic graphics game. The one in the assets store look very good indeed, I think I will go with that for my game. neoshaman, that tutorial is very interesting, but I am working in all aspects of my game and don't have time to learn about shaders really. Thank you for the link, it was very interesting read. Regards, Carlos
Yea if you want to save a few bucks just put the code relating to iridescence into unitys standard shader which has specular and detail maps etc. I cannot recommend learning shaders enough if you end up with the spare time. Good luck with the project!
I would love to learn shader programming but I am in a tight deadline with the Xbox One folks so I really can't at least for this game, but you can be sure I will as soon as I have a down time. I think it is one of the most important knowledge to have if you want to create a nice looking and fast fps game. Anyways thank you for your input, very appreciated. Regards, Carlos
# Iridescence Shader you can download this shader from my github : https://github.com/smkplus/Iridescence
Seyed_Morteza_Kamaly, I appreciate very much you offering a shader for free. The problem that the shader I am looking for most have specular, smoothness, and the other properties of the standard Unity shader. To be more clear I need this shader to create realistic fish skin, like Tuna, Jacks, Barracudas, etc... This type of fish's skin are Iridescent. But your offer is very nice. Regards, Carlos
Hi Dear Friend I added Surface Shader to my repository some new properties BumpMap BumpPower Metallic Glossiness Hue Saturation Brightness Contrast
@Seyed_Morteza_Kamaly Thanks for sharing, looks really nice. Any change to add license, that allows us to use it in our games?
@Seyed_Morteza_Kamaly, Thank you so much!! This is perfect brother, exactly what I was looking for! I tested last night and it works perfectly. I appreciate it very much, thanks a bunch! Regards, Carlos
Wow! this is super cool brother!! Great work! You remind me of when there were a lot of people in these forums helping each other instead of selling everything in the asset store. Now a days pretty much everything has to be bought and there are more people selling assets than creating games. Any way... Great job and thanks again brother. Regards, Carlos
I made a Tutorial about Iridescent Shader Tutorial : https://www.patreon.com/posts/18699278 Youtube : https://www.youtube.com/watch?v=l2jQC3UdWxU Source : https://github.com/smkplus/Iridescence Please support me to making more tutorials
I just noticed this thread. Thank you very much for providing these shaders. I found good use for the soap bubbles here: Now people keep asking me to provide a GitHub repo for the bubble instantiation and wrapping around an enemy. Is it okay to integrate your shader into my repo if I create one, credits of course to you for the bubbles. I see it's MIT licensed, but since it's all based on your work, I'd like to ask you nontheless.
Nice Job! I'm so glad it helped you it's free to use you can share with anyone thank you for using my shader
Hi Danny unfortunately Patreon closed my page because I'm an Iranian developer and I lost my funds and access to my page.
Sorry to hear! A great pity. Now I know why the screenshots aren't visible, too. All the best to you! Would you mind if @Rowlan re-shared your wonderful shaders and tech and whatever they have of this direction? If Rowlan still has the stuff, and the time to share, it... obviously, too.
That's tough to hear. One of the reasons I don't like Patreon. Do you have a donation account other than Patreon? I do, but Seyed's GitHub page is still here: https://github.com/smkplus/Iridescence