Announcement

Collapse
No announcement yet.

mr mip_grayball for vray?

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

  • #16
    would be nice to be able to access the bitmap options for the shadermap, so to be able to rotate an image or use colorcorrections

    Comment


    • #17
      how do you control the "sharpness" of the map ?

      i have a one basic scene with a teapot where the litsphere texture is blurry, and one older scene where to want to try the texture, where the texture map is 100% sharp

      Comment


      • #18
        Can you show me an image? Does turning off texture filtering in the V-Ray settings solve the problem (if there is one at all)?

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

        Comment


        • #19
          here are my two test scenes.
          lit material is created the same way, but one time it renders blurry (new scene), the other time sharp (old used scene where i created the same objects).

          what is even more strange is, that when i import the teapot from the blury scene, it stays blury in the "sharp" scene

          if you have any idea...

          and would be great it we could access to some more image control from the map file that is used

          thanks anyway for checking

          https://dl.dropbox.com/u/14772771/scene.zip

          edit: what's even more strange, when i have imported the 2 blury objects in the sharp scene, they remain blury even if i apply the "sharp" looking material (which are anyway 100% identical) Maybe it's object related?
          Attached Files
          Last edited by muoto; 16-06-2012, 04:42 AM.

          Comment


          • #20
            aha! It can use also as Texture!
            Thanks good tip.

            Is there any solution which is composite of self shadowing and shadow with one path to a litsphere material? (not AO)
            It may be useful if there is matte shadow "texture".

            OakCorp Japan - Yuji Yamauchi
            oakcorp.net
            v-ray.jp

            Comment


            • #21
              Vlado, did you had any time to have a look ?
              Thanks!

              Comment


              • #22
                It's quite sure I'm doing something wrong but here just trying to load the frag file immediately crashes max.
                I'm using 3dsmax design 2011 x64 with VRay 2.20.03, any suggestions?
                Alessandro

                Comment


                • #23
                  Originally posted by muoto View Post
                  Vlado, did you had any time to have a look ?Thanks!
                  Yes, it seems related to the object size. We are looking into why this happens.

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

                  Comment


                  • #24
                    Originally posted by muoto View Post
                    here are my two test scenes.
                    lit material is created the same way, but one time it renders blurry (new scene), the other time sharp (old used scene where i created the same objects).

                    what is even more strange is, that when i import the teapot from the blury scene, it stays blury in the "sharp" scene

                    if you have any idea...

                    and would be great it we could access to some more image control from the map file that is used

                    thanks anyway for checking

                    https://dl.dropbox.com/u/14772771/scene.zip

                    edit: what's even more strange, when i have imported the 2 blury objects in the sharp scene, they remain blury even if i apply the "sharp" looking material (which are anyway 100% identical) Maybe it's object related?
                    As Vlado has already mentioned the problem is related to the object sizes. In both scenes the geometry primitives have the "Real-World Map Size" option enabled. However, in the blurry scene the objects are much larger than those from the sharp scene, causing the uvw coordinates to appear much finer. This forces Max to filter the image using larger areas thus creating blurry effects and artifacts.

                    The solution, which I hope you find suitable, is to disable the "Real-World Map Size" option of each object, or just have in mind the sizes of the objects.

                    Please note that in general texture filtering would work just fine if we use the actual texture coordinates themselves.
                    In this particular fragment shader, we must use the shading normal to calculate the texture sampling (uv) coordinates.
                    Unfortunately the shading normal is not related to the uvw coordinates of the object, which in this case causes bad filtering problems.

                    Comment


                    • #25
                      Vlado, I tried taking your GLSL code

                      Code:
                      uniform sampler2D litspheremap;
                      void main() {
                          vec3 normal = (gl_FrontFacing) ? vr_Normal : -vr_Normal;
                          float u=clamp(normal.x*0.5+0.5, 0.0, 1.0);
                          float v=clamp(normal.y*0.5+0.5, 0.0, 1.0);
                          gl_FragColor=texture2D(
                      litspheremap, vec2(u, v));
                          gl_FragColor.w=1.0;
                      }
                      and converting it to OSL:

                      Code:
                      shader MatcapTex
                      (
                      string LitSphereMap_texture = "color.png",
                      output color result = 1
                      )
                      
                      {
                          float U = clamp (N[0] * 0.5 + 0.5, 0.0, 1.0);
                          float V = clamp (N[1] * 0.5 + 0.5, 0.0, 1.0);
                          color Color = texture (LitSphereMap_texture, U, V);
                          result = Color;
                      }
                      However it's not mapping properly to the camera coordinates. I believe this is because of the line
                      Code:
                      color Color = texture (LitSphereMap_texture, U, V);
                      Would you be so kind as to tell me what it should be?

                      Comment


                      • #26
                        Hi,

                        You need to convert from common space to camera space:

                        Code:
                        shader MatcapTex
                        (
                        	string LitSphereMap_texture = "color.png",
                        	output color result = color(0)
                        )
                        
                        {
                        	normal n_camspace = transform ("common", "camera", N); 
                        	float f_u = clamp (n_camspace[0] * 0.5 + 0.5, 0.0, 1.0);
                        	float f_v = clamp (n_camspace[1] * 0.5 + 0.5, 0.0, 1.0);
                        	color c_out = texture (LitSphereMap_texture, f_u, f_v);
                        	result = c_out;
                        }
                        (I renamed your variables so they're not so similar to global variables. )
                        Last edited by Rens; 18-12-2015, 12:07 AM.
                        Rens Heeren
                        Generalist
                        WEBSITE - IMDB - LINKEDIN - OSL SHADERS

                        Comment


                        • #27
                          Brilliant! Thanks Rens!

                          Comment

                          Working...
                          X