Announcement

Collapse
No announcement yet.

SDK: eval() and GI

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

  • SDK: eval() and GI

    Hi,

    if I enable GI for rendering and add a RenderElement "GlobalIllumination", I get the GI in the renderElement but not on my BeautyRGB..

    How do I handle the GI in the eval() or any other function to add it to my final-output-color?

    Aya~

  • #2
    Are you writing a material? This will be done automatically if you call VRenderMtl::shade(). You need to make sure that getDiffuseColor() returns the proper color of the surface.

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

    Comment


    • #3
      Yep, I am writing a Material.

      Should getDiffuse() return only the color that will end up in the "VRayDiffuseFilter"-RenderElement, or realy the whole computed diffuse?

      If it has to return the whole diffuse.. then, what's the difference between "getDiffuse" and "eval" with the FBRDF_DIFFUSE flag?


      I call the shade() function, but on the backside of my objects that is not illuminated by any light the beauty-RGB is still black... when I do the same with a VRay Material it is light gray (because of the GI)..

      Aya~

      Comment


      • #4
        Originally posted by Aya View Post
        Should getDiffuse() return only the color that will end up in the "VRayDiffuseFilter"-RenderElement
        Yes, it should return just the diffuse filter color for the surface.

        I call the shade() function, but on the backside of my objects that is not illuminated by any light the beauty-RGB is still black... when I do the same with a VRay Material it is light gray (because of the GI)..
        Do you mean back side like the side that is in shadow from other lights, or the back view of a single surface (on the reverse side of the normal)?

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

        Comment


        • #5
          I made a image to show you what I mean



          My Shader isn't reacting to GI at all

          Comment


          • #6
            Change the traceForward method like this, and it should work:
            Code:
            void MyBaseBSDF::traceForward(VRayContext &rc, int doDiffuse) {
            	BRDFSampler::traceForward(rc, doDiffuse);
            	if (doDiffuse) rc.mtlresult.color+=rc.evalDiffuse()*diffuse_color;
            }
            Best regards,
            Vlado
            Last edited by vlado; 22-05-2009, 08:54 AM.
            I only act like I know everything, Rogers.

            Comment


            • #7
              Here is also attached a version of the VRayBlinn material example with added diffuse component and transparency.

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

              Comment


              • #8
                Hey, thanks a lot
                But I can't download it, because I don't have the permission for it

                Comment


                • #9
                  Email me to vlado@chaosgroup.com and I'll send it.

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

                  Comment


                  • #10
                    (Could you delete the post with my mail adress when you got it? )

                    Comment


                    • #11
                      Yep, I just replied to your email, apologies for the delay.

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

                      Comment


                      • #12
                        Thanks a lot~ it's working now

                        Comment

                        Working...
                        X