Announcement

Collapse
No announcement yet.

VRayGLSL - Support for textureCube

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

  • VRayGLSL - Support for textureCube

    I may have made this request a few years ago, but I can't find it here as a thread so here it is! texCube support please

  • #2
    It was added to the nightly builds and for the next service pack long ago (in fact, almost as soon as you requested it )

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

    Comment


    • #3
      Oh awesome! Now I can port interior mapping

      Comment


      • #4
        What format is it expecting for the cubemap? A regular bitmap map as explicit map channel, as a cubemap cross? I've tried a few and cant work it out.

        Comment


        • #5
          You've got everything right so far.
          Yes it accepts a single image file in a horizontal cross configuration, more specifically:
          ....+Y.........
          -X +Z +X -Z
          ....-Y.........
          The image you attached is in the correct format.

          Now the only thing left we need to make sure is OK is the fragment shader itself.
          I've attached an example that uses a cubemap texture as a reflection environment.
          Rename the extension to frag and load it in a VRayGLSLTex or a VRayGLSLMtl plugin.

          Just attach a standard Max Bitmap texture to the GLSL plugin and load the cubemap image.
          To get rid of the edge seams turn off texture filtering.

          If this is not an option try and create a cubemap on your own but make sure to extend the image tiles (the cube sides) in any way you find appropriate into the the black areas.
          That way the filter will not reach them and will not create artifacts. The easiest way I can think of is painting the black spaces adequately.

          We had a thread discussing this next problem but I want to mention it just in case.
          You see, to sample the texture we use a direction (a vector) that is not necessarily related to the texture coordinates of the object.
          This may lead to very bad filtering artifacts if "Real-World Map Size" option is activated.
          Please try and keep it off or just mind the size of the object (it must be really, really small).
          Attached Files

          Comment


          • #6
            Interior mapping could get a bit tricky.

            Luckily there is a pretty decent example here with all the materials you need:
            http://www.humus.name/index.php?page=3D&ID=80

            If you don't mind I could offer an example vrayGLSL translation of the above method attached to this post.
            Note that for the cube map texture you should not use an environment one as it holds projection distortion.

            I stitched the room textures provided by the web site into a single cube map using the template from my previous post.

            Here it is, hope you find it useful.

            P.S. For the exterior texture use the <download_folder>\InteriorMapping\Textures\Window. dds and set the Bitmap texture's alpha source to "Image Alpha".
            Attached Files

            Comment


            • #7
              Brilliant! I've got a bit of time on my hands now so i'll work on this a bit to support multiple textures and so on. Fingers crossed I can get it to work with BerconTile.

              Comment

              Working...
              X