Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Andy Touch[es] on Physical-Based Shading, Reflection Probes, WebGL in Unity 5

Discussion in 'General Discussion' started by Aurore, Aug 11, 2014.

  1. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Yeah god forbid a plastic balloon would look like plastic...
     
    Deleted User likes this.
  2. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    Wait, does the uber shader have fresnal controls? because even marmoset skyshop currently has that. Would be insane if unity decided to make something the community has already made except did it worse.
     
  3. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    @Aras Well this is not a request, i just really curious. Is Unity5 have new light atten type? Hoping there's an Inv Square Falloff in unity5
     
    Jingle-Fett likes this.
  4. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    You can already do this sort of thing since Unity 3 if I'm not mistaken, for example in the surface shader:
    Code (CSharp):
    1. #pragma surface surf SimpleLambert
    2.  
    3.   half4 LightingSimpleLambert (SurfaceOutput s, half3 lightDir, half atten) {
    4.       half NdotL = dot (s.Normal, lightDir);
    5.       half4 c;
    6.       c.rgb = s.Albedo * _LightColor0.rgb * (NdotL * atten * 2);
    7.       c.a = s.Alpha;
    8.       return c;
    9.   }
    http://docs.unity3d.com/Manual/SL-SurfaceShaderLightingExamples.html

    Pretty easy to tinker with.
     
    ippdev, Reanimate_L and Deleted User like this.
  5. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Yes it is, what i mean is like built in so we don't have to use custom light prepass or custom shader. Sorry i should've made my previous post more clearer :p
     
    hippocoder likes this.
  6. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Oh you mean a drop down list for the standard shader, so you can choose a light model? Hopefully Aras and the team at Unity will read this and consider it, at least for common variants. It's not hard for the community to come up with but I see your point yes :)

    Probably should have options for Rim/Fresnel too, or whatever else. The lack of a node based shader editor is probably why everyone asks for so many features.
     
    Jingle-Fett likes this.
  7. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Yep, something like that. For light Atten it could be an option in Point/Spot light only i think not sure if we need it on Directional light.
    And that would be awesome if we have those.
     
  8. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,850
    It should go on the light even though functionally under the hood it is the shader. The light attenuation, whether inverse square, linear or infinite is passed light by light to the shader surface which can interpret the various light attenuation parameters from lights in the scene and render the diffuse, normal, specular and what have you maps with the light value at that surface sampled point/pixel. Every 3D app I have ever worked with uses lights with attenuation parameters on that are interpreted from the materials on the objects in the render.
     
    Jingle-Fett likes this.
  9. ippdev

    ippdev

    Joined:
    Feb 7, 2010
    Posts:
    3,850
    Dual reflectance channels that each had their own fresnel, specular and texture channel could be used for gloss candy car paint, exotic multihued metal, more realistic gunmetal that gets those secondary purplish hues to it and all kinds of interesting minerals and crystals, sword hilts, gloss carbon fiber with depth etc.. C4D16 included this with their latest shader and some of the results are pretty nice eye candy. Can this be done with Unity shaders?