Ambient occlusion of a sole object in a scene

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
4
down vote

favorite
1












So, the german wikipedia states about ambient occlusion:


The ambient occlusion method is based on the assumption that an object, a set of objects or an entire scene is surrounded by a unit sphere of light.


Now, let's suppose we've got a scene in which the only object is a pipe, closed at one end, at the center of the scene. If I got this right, then to get the ambient occlusion this object would now be evenly light from every direction.



But wouldn't lighting the object evenly from everywhere mean that for every point in the pipe there would also be a ray of light that would directly reach it, leading to no ambient occlusion at all (no shadows inside the pipe)?



What did I get wrong here?










share|improve this question

























    up vote
    4
    down vote

    favorite
    1












    So, the german wikipedia states about ambient occlusion:


    The ambient occlusion method is based on the assumption that an object, a set of objects or an entire scene is surrounded by a unit sphere of light.


    Now, let's suppose we've got a scene in which the only object is a pipe, closed at one end, at the center of the scene. If I got this right, then to get the ambient occlusion this object would now be evenly light from every direction.



    But wouldn't lighting the object evenly from everywhere mean that for every point in the pipe there would also be a ray of light that would directly reach it, leading to no ambient occlusion at all (no shadows inside the pipe)?



    What did I get wrong here?










    share|improve this question























      up vote
      4
      down vote

      favorite
      1









      up vote
      4
      down vote

      favorite
      1






      1





      So, the german wikipedia states about ambient occlusion:


      The ambient occlusion method is based on the assumption that an object, a set of objects or an entire scene is surrounded by a unit sphere of light.


      Now, let's suppose we've got a scene in which the only object is a pipe, closed at one end, at the center of the scene. If I got this right, then to get the ambient occlusion this object would now be evenly light from every direction.



      But wouldn't lighting the object evenly from everywhere mean that for every point in the pipe there would also be a ray of light that would directly reach it, leading to no ambient occlusion at all (no shadows inside the pipe)?



      What did I get wrong here?










      share|improve this question













      So, the german wikipedia states about ambient occlusion:


      The ambient occlusion method is based on the assumption that an object, a set of objects or an entire scene is surrounded by a unit sphere of light.


      Now, let's suppose we've got a scene in which the only object is a pipe, closed at one end, at the center of the scene. If I got this right, then to get the ambient occlusion this object would now be evenly light from every direction.



      But wouldn't lighting the object evenly from everywhere mean that for every point in the pipe there would also be a ray of light that would directly reach it, leading to no ambient occlusion at all (no shadows inside the pipe)?



      What did I get wrong here?







      ambient-occlusion






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 29 at 7:02









      yot

      233




      233




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted










          When you compute ambient occlusion (AO) for a point on an object's surface, you sample multiple directions and measure what fraction of them escape. That is, you're trying to approximate what fraction of the unit hemisphere is visible to that point on the surface. (Note that it's a unit hemisphere because half of the unit sphere is on the wrong side of the surface to start with.)



          So in your pipe example, the outside of the pipe is not at all occluded. From every point on the outside, any ray fired in that hemisphere will escape without intersecting the object. All of the outside would be lit with 100% of the ambient light.



          The inside is another matter. The inside of the end cap can only see a small circle of that hemisphere, through the other end of the pipe. The exact fraction depends on the radius and length of the pipe, but call it 10% for the example. 90% of rays fired from a point on the end cap will hit the inside of the cap, and the other 10% will escape along the length of the pipe and out of the other end. These points are 90% occluded, so they'll be lit with 10% of the ambient light.



          Consider a point at the open end of the pipe, but on the inside. This point is 50% occluded. Half of the rays fired from it go into the pipe and intersect with it at some point. The other half go straight out and escape to the unit hemisphere. This point will be lit with 50% of the ambient light, and it's easy to see that the 50% will smoothly decrease to the 10% (or however much is the minimum) as you travel down the inside of the pipe towards the end cap, as less of that hole is visible.



          The important point I think you misunderstood is that you measure or estimate what fraction of the unit hemisphere is visible from the point you're shading, not whether it's visible at all. Casting many rays and counting what fraction escape is one way of estimating this.






          share|improve this answer




















          • With "hemisphere on the wrong side of the surface" do you mean the bottom hemisphere? Why is it on the wrong side when in this scene there's no such thing like a ground?
            – yot
            Aug 29 at 10:13






          • 2




            @yot No, I mean the hemisphere that is back-facing with respect to the surface; the opposite side from the surface normal. Just like in direct lighting, each point can only be lit from half of space.
            – Dan Hulme♦
            Aug 29 at 10:35










          • Objects are made up of flat surfaces and flat surfaces have surface normals on both side, I think. Is the "front-facing" side of the surface the one the 'sees' the sky and not the interior of the object it belongs to?
            – yot
            Aug 29 at 13:37






          • 1




            If you consider a polygon mesh, it's usual for surfaces to have only one side and one surface normal: the back face is typically not drawn at all. This is because the inside of the surface isn't visible. What you said is possible too, but even then, you still have to light each side of the surface separately, otherwise surfaces could be illuminated by lights that are actually behind them. This is a much bigger discussion than just AO though.
            – Dan Hulme♦
            Aug 29 at 14:13

















          up vote
          3
          down vote













          Ambient occlusion is basically shooting out a large number of rays diffusely from a surface point. In a pipe some of the rays will intersect with the pipe itself, which means that this surface point will not receive as much ambience as points that don't have intersecting rays. The inside of the pipe vs the outside of the pipe will be different.






          share|improve this answer




















            Your Answer




            StackExchange.ifUsing("editor", function ()
            return StackExchange.using("mathjaxEditing", function ()
            StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
            StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
            );
            );
            , "mathjax-editing");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "633"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcomputergraphics.stackexchange.com%2fquestions%2f7985%2fambient-occlusion-of-a-sole-object-in-a-scene%23new-answer', 'question_page');

            );

            Post as a guest






























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            4
            down vote



            accepted










            When you compute ambient occlusion (AO) for a point on an object's surface, you sample multiple directions and measure what fraction of them escape. That is, you're trying to approximate what fraction of the unit hemisphere is visible to that point on the surface. (Note that it's a unit hemisphere because half of the unit sphere is on the wrong side of the surface to start with.)



            So in your pipe example, the outside of the pipe is not at all occluded. From every point on the outside, any ray fired in that hemisphere will escape without intersecting the object. All of the outside would be lit with 100% of the ambient light.



            The inside is another matter. The inside of the end cap can only see a small circle of that hemisphere, through the other end of the pipe. The exact fraction depends on the radius and length of the pipe, but call it 10% for the example. 90% of rays fired from a point on the end cap will hit the inside of the cap, and the other 10% will escape along the length of the pipe and out of the other end. These points are 90% occluded, so they'll be lit with 10% of the ambient light.



            Consider a point at the open end of the pipe, but on the inside. This point is 50% occluded. Half of the rays fired from it go into the pipe and intersect with it at some point. The other half go straight out and escape to the unit hemisphere. This point will be lit with 50% of the ambient light, and it's easy to see that the 50% will smoothly decrease to the 10% (or however much is the minimum) as you travel down the inside of the pipe towards the end cap, as less of that hole is visible.



            The important point I think you misunderstood is that you measure or estimate what fraction of the unit hemisphere is visible from the point you're shading, not whether it's visible at all. Casting many rays and counting what fraction escape is one way of estimating this.






            share|improve this answer




















            • With "hemisphere on the wrong side of the surface" do you mean the bottom hemisphere? Why is it on the wrong side when in this scene there's no such thing like a ground?
              – yot
              Aug 29 at 10:13






            • 2




              @yot No, I mean the hemisphere that is back-facing with respect to the surface; the opposite side from the surface normal. Just like in direct lighting, each point can only be lit from half of space.
              – Dan Hulme♦
              Aug 29 at 10:35










            • Objects are made up of flat surfaces and flat surfaces have surface normals on both side, I think. Is the "front-facing" side of the surface the one the 'sees' the sky and not the interior of the object it belongs to?
              – yot
              Aug 29 at 13:37






            • 1




              If you consider a polygon mesh, it's usual for surfaces to have only one side and one surface normal: the back face is typically not drawn at all. This is because the inside of the surface isn't visible. What you said is possible too, but even then, you still have to light each side of the surface separately, otherwise surfaces could be illuminated by lights that are actually behind them. This is a much bigger discussion than just AO though.
              – Dan Hulme♦
              Aug 29 at 14:13














            up vote
            4
            down vote



            accepted










            When you compute ambient occlusion (AO) for a point on an object's surface, you sample multiple directions and measure what fraction of them escape. That is, you're trying to approximate what fraction of the unit hemisphere is visible to that point on the surface. (Note that it's a unit hemisphere because half of the unit sphere is on the wrong side of the surface to start with.)



            So in your pipe example, the outside of the pipe is not at all occluded. From every point on the outside, any ray fired in that hemisphere will escape without intersecting the object. All of the outside would be lit with 100% of the ambient light.



            The inside is another matter. The inside of the end cap can only see a small circle of that hemisphere, through the other end of the pipe. The exact fraction depends on the radius and length of the pipe, but call it 10% for the example. 90% of rays fired from a point on the end cap will hit the inside of the cap, and the other 10% will escape along the length of the pipe and out of the other end. These points are 90% occluded, so they'll be lit with 10% of the ambient light.



            Consider a point at the open end of the pipe, but on the inside. This point is 50% occluded. Half of the rays fired from it go into the pipe and intersect with it at some point. The other half go straight out and escape to the unit hemisphere. This point will be lit with 50% of the ambient light, and it's easy to see that the 50% will smoothly decrease to the 10% (or however much is the minimum) as you travel down the inside of the pipe towards the end cap, as less of that hole is visible.



            The important point I think you misunderstood is that you measure or estimate what fraction of the unit hemisphere is visible from the point you're shading, not whether it's visible at all. Casting many rays and counting what fraction escape is one way of estimating this.






            share|improve this answer




















            • With "hemisphere on the wrong side of the surface" do you mean the bottom hemisphere? Why is it on the wrong side when in this scene there's no such thing like a ground?
              – yot
              Aug 29 at 10:13






            • 2




              @yot No, I mean the hemisphere that is back-facing with respect to the surface; the opposite side from the surface normal. Just like in direct lighting, each point can only be lit from half of space.
              – Dan Hulme♦
              Aug 29 at 10:35










            • Objects are made up of flat surfaces and flat surfaces have surface normals on both side, I think. Is the "front-facing" side of the surface the one the 'sees' the sky and not the interior of the object it belongs to?
              – yot
              Aug 29 at 13:37






            • 1




              If you consider a polygon mesh, it's usual for surfaces to have only one side and one surface normal: the back face is typically not drawn at all. This is because the inside of the surface isn't visible. What you said is possible too, but even then, you still have to light each side of the surface separately, otherwise surfaces could be illuminated by lights that are actually behind them. This is a much bigger discussion than just AO though.
              – Dan Hulme♦
              Aug 29 at 14:13












            up vote
            4
            down vote



            accepted







            up vote
            4
            down vote



            accepted






            When you compute ambient occlusion (AO) for a point on an object's surface, you sample multiple directions and measure what fraction of them escape. That is, you're trying to approximate what fraction of the unit hemisphere is visible to that point on the surface. (Note that it's a unit hemisphere because half of the unit sphere is on the wrong side of the surface to start with.)



            So in your pipe example, the outside of the pipe is not at all occluded. From every point on the outside, any ray fired in that hemisphere will escape without intersecting the object. All of the outside would be lit with 100% of the ambient light.



            The inside is another matter. The inside of the end cap can only see a small circle of that hemisphere, through the other end of the pipe. The exact fraction depends on the radius and length of the pipe, but call it 10% for the example. 90% of rays fired from a point on the end cap will hit the inside of the cap, and the other 10% will escape along the length of the pipe and out of the other end. These points are 90% occluded, so they'll be lit with 10% of the ambient light.



            Consider a point at the open end of the pipe, but on the inside. This point is 50% occluded. Half of the rays fired from it go into the pipe and intersect with it at some point. The other half go straight out and escape to the unit hemisphere. This point will be lit with 50% of the ambient light, and it's easy to see that the 50% will smoothly decrease to the 10% (or however much is the minimum) as you travel down the inside of the pipe towards the end cap, as less of that hole is visible.



            The important point I think you misunderstood is that you measure or estimate what fraction of the unit hemisphere is visible from the point you're shading, not whether it's visible at all. Casting many rays and counting what fraction escape is one way of estimating this.






            share|improve this answer












            When you compute ambient occlusion (AO) for a point on an object's surface, you sample multiple directions and measure what fraction of them escape. That is, you're trying to approximate what fraction of the unit hemisphere is visible to that point on the surface. (Note that it's a unit hemisphere because half of the unit sphere is on the wrong side of the surface to start with.)



            So in your pipe example, the outside of the pipe is not at all occluded. From every point on the outside, any ray fired in that hemisphere will escape without intersecting the object. All of the outside would be lit with 100% of the ambient light.



            The inside is another matter. The inside of the end cap can only see a small circle of that hemisphere, through the other end of the pipe. The exact fraction depends on the radius and length of the pipe, but call it 10% for the example. 90% of rays fired from a point on the end cap will hit the inside of the cap, and the other 10% will escape along the length of the pipe and out of the other end. These points are 90% occluded, so they'll be lit with 10% of the ambient light.



            Consider a point at the open end of the pipe, but on the inside. This point is 50% occluded. Half of the rays fired from it go into the pipe and intersect with it at some point. The other half go straight out and escape to the unit hemisphere. This point will be lit with 50% of the ambient light, and it's easy to see that the 50% will smoothly decrease to the 10% (or however much is the minimum) as you travel down the inside of the pipe towards the end cap, as less of that hole is visible.



            The important point I think you misunderstood is that you measure or estimate what fraction of the unit hemisphere is visible from the point you're shading, not whether it's visible at all. Casting many rays and counting what fraction escape is one way of estimating this.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Aug 29 at 8:05









            Dan Hulme♦

            4,8531631




            4,8531631











            • With "hemisphere on the wrong side of the surface" do you mean the bottom hemisphere? Why is it on the wrong side when in this scene there's no such thing like a ground?
              – yot
              Aug 29 at 10:13






            • 2




              @yot No, I mean the hemisphere that is back-facing with respect to the surface; the opposite side from the surface normal. Just like in direct lighting, each point can only be lit from half of space.
              – Dan Hulme♦
              Aug 29 at 10:35










            • Objects are made up of flat surfaces and flat surfaces have surface normals on both side, I think. Is the "front-facing" side of the surface the one the 'sees' the sky and not the interior of the object it belongs to?
              – yot
              Aug 29 at 13:37






            • 1




              If you consider a polygon mesh, it's usual for surfaces to have only one side and one surface normal: the back face is typically not drawn at all. This is because the inside of the surface isn't visible. What you said is possible too, but even then, you still have to light each side of the surface separately, otherwise surfaces could be illuminated by lights that are actually behind them. This is a much bigger discussion than just AO though.
              – Dan Hulme♦
              Aug 29 at 14:13
















            • With "hemisphere on the wrong side of the surface" do you mean the bottom hemisphere? Why is it on the wrong side when in this scene there's no such thing like a ground?
              – yot
              Aug 29 at 10:13






            • 2




              @yot No, I mean the hemisphere that is back-facing with respect to the surface; the opposite side from the surface normal. Just like in direct lighting, each point can only be lit from half of space.
              – Dan Hulme♦
              Aug 29 at 10:35










            • Objects are made up of flat surfaces and flat surfaces have surface normals on both side, I think. Is the "front-facing" side of the surface the one the 'sees' the sky and not the interior of the object it belongs to?
              – yot
              Aug 29 at 13:37






            • 1




              If you consider a polygon mesh, it's usual for surfaces to have only one side and one surface normal: the back face is typically not drawn at all. This is because the inside of the surface isn't visible. What you said is possible too, but even then, you still have to light each side of the surface separately, otherwise surfaces could be illuminated by lights that are actually behind them. This is a much bigger discussion than just AO though.
              – Dan Hulme♦
              Aug 29 at 14:13















            With "hemisphere on the wrong side of the surface" do you mean the bottom hemisphere? Why is it on the wrong side when in this scene there's no such thing like a ground?
            – yot
            Aug 29 at 10:13




            With "hemisphere on the wrong side of the surface" do you mean the bottom hemisphere? Why is it on the wrong side when in this scene there's no such thing like a ground?
            – yot
            Aug 29 at 10:13




            2




            2




            @yot No, I mean the hemisphere that is back-facing with respect to the surface; the opposite side from the surface normal. Just like in direct lighting, each point can only be lit from half of space.
            – Dan Hulme♦
            Aug 29 at 10:35




            @yot No, I mean the hemisphere that is back-facing with respect to the surface; the opposite side from the surface normal. Just like in direct lighting, each point can only be lit from half of space.
            – Dan Hulme♦
            Aug 29 at 10:35












            Objects are made up of flat surfaces and flat surfaces have surface normals on both side, I think. Is the "front-facing" side of the surface the one the 'sees' the sky and not the interior of the object it belongs to?
            – yot
            Aug 29 at 13:37




            Objects are made up of flat surfaces and flat surfaces have surface normals on both side, I think. Is the "front-facing" side of the surface the one the 'sees' the sky and not the interior of the object it belongs to?
            – yot
            Aug 29 at 13:37




            1




            1




            If you consider a polygon mesh, it's usual for surfaces to have only one side and one surface normal: the back face is typically not drawn at all. This is because the inside of the surface isn't visible. What you said is possible too, but even then, you still have to light each side of the surface separately, otherwise surfaces could be illuminated by lights that are actually behind them. This is a much bigger discussion than just AO though.
            – Dan Hulme♦
            Aug 29 at 14:13




            If you consider a polygon mesh, it's usual for surfaces to have only one side and one surface normal: the back face is typically not drawn at all. This is because the inside of the surface isn't visible. What you said is possible too, but even then, you still have to light each side of the surface separately, otherwise surfaces could be illuminated by lights that are actually behind them. This is a much bigger discussion than just AO though.
            – Dan Hulme♦
            Aug 29 at 14:13










            up vote
            3
            down vote













            Ambient occlusion is basically shooting out a large number of rays diffusely from a surface point. In a pipe some of the rays will intersect with the pipe itself, which means that this surface point will not receive as much ambience as points that don't have intersecting rays. The inside of the pipe vs the outside of the pipe will be different.






            share|improve this answer
























              up vote
              3
              down vote













              Ambient occlusion is basically shooting out a large number of rays diffusely from a surface point. In a pipe some of the rays will intersect with the pipe itself, which means that this surface point will not receive as much ambience as points that don't have intersecting rays. The inside of the pipe vs the outside of the pipe will be different.






              share|improve this answer






















                up vote
                3
                down vote










                up vote
                3
                down vote









                Ambient occlusion is basically shooting out a large number of rays diffusely from a surface point. In a pipe some of the rays will intersect with the pipe itself, which means that this surface point will not receive as much ambience as points that don't have intersecting rays. The inside of the pipe vs the outside of the pipe will be different.






                share|improve this answer












                Ambient occlusion is basically shooting out a large number of rays diffusely from a surface point. In a pipe some of the rays will intersect with the pipe itself, which means that this surface point will not receive as much ambience as points that don't have intersecting rays. The inside of the pipe vs the outside of the pipe will be different.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Aug 29 at 8:02









                beyond

                1213




                1213



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcomputergraphics.stackexchange.com%2fquestions%2f7985%2fambient-occlusion-of-a-sole-object-in-a-scene%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Displaying single band from multi-band raster using QGIS

                    How many registers does an x86_64 CPU actually have?