Announcement

Collapse
No announcement yet.

"Everything has fresnel!"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Originally posted by Yannick View Post
    but a ramp plug in the colour would follow the UV of the geometry...
    Use facing ratio.
    www.deex.info

    Comment


    • #17
      Can't you map a ramp to a sampler node in maya?

      Comment


      • #18
        Originally posted by joconnell View Post
        Can't you map a ramp to a sampler node in maya?
        That what i usually do. I was hoping for something more physically correct.
        Portfolio: http://www.cgifocus.co.uk

        Comment


        • #19
          Originally posted by Yannick View Post
          That what i usually do. I was hoping for something more physically correct.
          If you recreate the measured curve, it will be perfectly physically correct...

          Best regards,
          Vlado
          I only act like I know everything, Rogers.

          Comment


          • #20
            I am wondering how you would match the curve using the ramp node in Maya? It's a bit tricky to visualize the gray scale ramp color as a curve.....As least if we can have a curve with inserting control points to manually adjust the curve to match the calculated fresnel curve of a general wavelength....
            always curious...

            Comment


            • #21
              I'd imagine you just plot the curve's percentage reflection to a value between black and white at various steps along the way. It'd be brilliant to have some kind of spreadsheet data with say a value every 10 degrees of the facing ratio with a value of 0 - 100% reflectivity so you could make a simple curve - not as accurate as a full curve but still maybe better than what we've gone with before?

              Comment


              • #22
                Here's an idea of what your curves would look like if you were doing rgb bits:



                It seems that metals not only have really weird curves based on the angle you're viewing from, they also have different strengths of reflection for different parts of the spectrum of light which is what gives gold it's yellowy reflections and so on! all from http://en.wikipedia.org/wiki/Reflectivity by the way.

                Comment


                • #23
                  Originally posted by jasonhuang1115 View Post
                  I am wondering how you would match the curve using the ramp node in Maya? It's a bit tricky to visualize the gray scale ramp color as a curve.....As least if we can have a curve with inserting control points to manually adjust the curve to match the calculated fresnel curve of a general wavelength....
                  Use a ramp.
                  To understand how you can do this, here a curve, and here a ramp :
                  www.deex.info

                  Comment


                  • #24
                    Originally posted by jasonhuang1115 View Post
                    I am wondering how you would match the curve using the ramp node in Maya? It's a bit tricky to visualize the gray scale ramp color as a curve.....As least if we can have a curve with inserting control points to manually adjust the curve to match the calculated fresnel curve of a general wavelength....
                    You can plug a ramp into remap node which has curves.
                    Dmitry Vinnik
                    Silhouette Images Inc.
                    ShowReel:
                    https://www.youtube.com/watch?v=qxSJlvSwAhA
                    https://www.linkedin.com/in/dmitry-v...-identity-name

                    Comment


                    • #25
                      @Dmitry, which remap node would you recommend? The Remap Color, Remap HSV, or the Remap Value?

                      @Damien, which ramp you were referring? The 2D Ramp texture I can find in Maya has a vertical interface?
                      always curious...

                      Comment


                      • #26
                        if you wish to control the value, you can use remap value, its a single channel. If you want to control color you can use remap hsv, since it accepts outcolor but has a value ramp, so you can affect the overall luminance of the texture.
                        Dmitry Vinnik
                        Silhouette Images Inc.
                        ShowReel:
                        https://www.youtube.com/watch?v=qxSJlvSwAhA
                        https://www.linkedin.com/in/dmitry-v...-identity-name

                        Comment


                        • #27
                          Thanks Dmitry. Seems to be a great way to have a curve control in Maya for simulating the fresnel effect curves.
                          always curious...

                          Comment


                          • #28
                            Just to speed up the process and to learn some mel, I wrote this simple script that creates and connects all necessary nodes (a facing ratio connected to a black/white ramp connected to a valueRemap).

                            Btw, does someone know of a site with more of these ior-curves?

                            string $fresnelSamplerInfo = `shadingNode -asUtility samplerInfo -name "fresnelSamplerInfo"`;

                            string $fresnelRamp = `shadingNode -asTexture ramp -name "fresnelRamp"`;
                            autoUpdateAttrEd;
                            setAttr ($fresnelRamp + ".colorEntryList[2].color") -type double3 0 0 0 ;
                            autoUpdateAttrEd;
                            setAttr ($fresnelRamp + ".colorEntryList[0].color") -type double3 1 1 1 ;
                            autoUpdateAttrEd;
                            removeMultiInstance -b true ( $fresnelRamp + ".colorEntryList[1]" );

                            string $fresnelRemapValue = `shadingNode -asUtility remapValue -name "fresnelRemapValue"`;

                            connectAttr -f ($fresnelSamplerInfo + ".facingRatio") ($fresnelRamp + ".vCoord");
                            connectAttr -f ($fresnelRamp + ".outColorR") ($fresnelRemapValue + ".inputValue");
                            Last edited by Ekenryd; 27-08-2012, 07:11 AM.

                            Comment


                            • #29
                              Thanks for sharing the script, Ekenryd. I did a quick test and it seems to me that I have to put a reverse node between the remap node and the Vray material's fresnel IOR so that the curve in the remap will control the fresnel reflection like the curves joconnell posted earlier (i.e. the closer the control point to value of 1 the more reflective it is). Also, it will be great if we can figure out a way to control this on a per R, G, B channel basis. Maybe through the Remap Color node?
                              always curious...

                              Comment


                              • #30
                                Hm, not sure what you mean with the reverse node, it works like expected here. From left to right you get 0 to 90 degree refl, and from down to up,0 to 1, you get 0% to 100% refl.

                                Here is a modified script which create a remap color node instead of remap value, plug it into the refl color.

                                Code:
                                string $fresnelSamplerInfo = `shadingNode -asUtility samplerInfo -name "fresnelSamplerInfo"`;
                                
                                string $fresnelRamp = `shadingNode -asTexture ramp -name "fresnelRamp"`;
                                autoUpdateAttrEd;
                                setAttr ($fresnelRamp + ".colorEntryList[2].color") -type double3 0 0 0 ;
                                autoUpdateAttrEd;
                                setAttr ($fresnelRamp + ".colorEntryList[0].color") -type double3 1 1 1 ;
                                autoUpdateAttrEd;
                                removeMultiInstance -b true ( $fresnelRamp + ".colorEntryList[1]" );
                                
                                string $fresnelRemapColor = `shadingNode -asUtility remapColor -name "fresnelRemapColor"`;
                                
                                connectAttr -f ($fresnelSamplerInfo + ".facingRatio") ($fresnelRamp + ".vCoord");
                                connectAttr -f ($fresnelRamp + ".outColorR") ($fresnelRemapColor + ".color.colorR");
                                connectAttr -f ($fresnelRamp + ".outColorG") ($fresnelRemapColor + ".color.colorG");
                                connectAttr -f ($fresnelRamp + ".outColorB") ($fresnelRemapColor + ".color.colorB");

                                Also, a tech question: Should I gamma correct this color remap node for linear workflow if I plug it into refl color? Wont that make the curve look different and hence the reflections wont be like the curve? On the other hand I've heard that you should always gamma correct colored reflections.
                                Last edited by Ekenryd; 28-08-2012, 06:06 AM.

                                Comment

                                Working...
                                X