Announcement

Collapse
No announcement yet.

Reflection Vector Scale

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

    Reflection Vector Scale

    Hi!
    First of all, sorry if this is the wrong forum for this, I'm kind of new with this and this is my first post.

    So I'm working on and stylized water shader that I'm hoping to upload to the marketplace with as much options as possible, and one of those options is between using high quality reflections with a planar reflection or more optimized reflections using a Screen Capture Cube.

    The problem I'm facing is that, when using a Screen Capture Cube texture with the Reflection Vector in the UVs, the reflection doesn't update the scale when you get farther from the plane, so the reflections get too big and are not precise at all.

    I've looked for a solution for this and found some posts from a few years back but the solution given is using a planar reflection instead, which doesn't work for me because that's already one of the options I give on my shader.

    I have tried to get the distance from the plane by subtracting the world position to the camera position and trying to get that to the scale of the texture but I can't find a way for it to work. Does someone know of a way to get this result?

    #2
    Originally posted by BalseiroFTS View Post
    Hi!
    First of all, sorry if this is the wrong forum for this, I'm kind of new with this and this is my first post.

    So I'm working on and stylized water shader that I'm hoping to upload to the marketplace with as much options as possible, and one of those options is between using high quality reflections with a planar reflection or more optimized reflections using a Screen Capture Cube.

    The problem I'm facing is that, when using a Screen Capture Cube texture with the Reflection Vector in the UVs, the reflection doesn't update the scale when you get farther from the plane, so the reflections get too big and are not precise at all.

    I've looked for a solution for this and found some posts from a few years back but the solution given is using a planar reflection instead, which doesn't work for me because that's already one of the options I give on my shader.

    I have tried to get the distance from the plane by subtracting the world position to the camera position and trying to get that to the scale of the texture but I can't find a way for it to work. Does someone know of a way to get this result?
    Screen capture cube is a very common noob trap, do not use it for reflections unless your making some sort of custom translucency/realtime reflections on all surfaces. Use reflection captures instead. Or if your doing it as a custom realtime reflection, still dont use capture cube, its over double the cost of a planar reflection even at 8x8x6 resolution.

    Comment


      #3
      Originally posted by Bits360 View Post

      Screen capture cube is a very common noob trap, do not use it for reflections unless your making some sort of custom translucency/realtime reflections on all surfaces. Use reflection captures instead. Or if your doing it as a custom realtime reflection, still dont use capture cube, its over double the cost of a planar reflection even at 8x8x6 resolution.
      Wow, I was actually told the opposite, that planar reflection was heavier on the GPU (I come from an artist background and still have a lot of engine knowledge to learn).
      Do you know of a good reflection captures tutorial? I've tried to work with sphere and box shapes but no matter how I place them the reflections always look a little off (normaly either moved or distorted)

      Thanks so much for your help

      Comment


        #4
        Originally posted by BalseiroFTS View Post

        Wow, I was actually told the opposite, that planar reflection was heavier on the GPU (I come from an artist background and still have a lot of engine knowledge to learn).
        Do you know of a good reflection captures tutorial? I've tried to work with sphere and box shapes but no matter how I place them the reflections always look a little off (normaly either moved or distorted)

        Thanks so much for your help
        Planar reflection is heavier, unless you update the cube per frame, as the cube has lower res, but, it captures everything six times which, well, your fps doesnt like it.

        Reflection captures are a little tricky, and, unfortunately distortion is literally impossible to avoid but you can reduce it to such a small level that nobody will ever notice (Actually, most games use this method, even if its put together sloppily nobody seems to actually care

        Heres how i put together each (Focusing on lowering distortion, not maximising res)
        For indoors: Generally you want to place box captures to fit the room as closely as possible, it doesn't have to be absolutely perfect and should go past the walls a bit to cover doorways, but, if it's matched up well, and the floors aren't at a mirror's shine, you can't really tell.

        For outdoors, water: You want to place sphere captures, with some overlap along the rivers, and place 1, big capture in the center of lakes, There will be obvious distortion, but, with good enough placement and a noisy water normalmap (Or even better yet, actual waves) nobody can tell

        For outdoors, near paths: You want captures near paths to go a bit out, in a large radius, as, you dont need much accuracy for those areas, but you might want to place them there anyways, as it makes reflections on characters match the environment, and, it makes specular more accurate.

        Comment


          #5
          Originally posted by Bits360 View Post

          Planar reflection is heavier, unless you update the cube per frame, as the cube has lower res, but, it captures everything six times which, well, your fps doesnt like it.

          Reflection captures are a little tricky, and, unfortunately distortion is literally impossible to avoid but you can reduce it to such a small level that nobody will ever notice (Actually, most games use this method, even if its put together sloppily nobody seems to actually care

          Heres how i put together each (Focusing on lowering distortion, not maximising res)
          For indoors: Generally you want to place box captures to fit the room as closely as possible, it doesn't have to be absolutely perfect and should go past the walls a bit to cover doorways, but, if it's matched up well, and the floors aren't at a mirror's shine, you can't really tell.

          For outdoors, water: You want to place sphere captures, with some overlap along the rivers, and place 1, big capture in the center of lakes, There will be obvious distortion, but, with good enough placement and a noisy water normalmap (Or even better yet, actual waves) nobody can tell

          For outdoors, near paths: You want captures near paths to go a bit out, in a large radius, as, you dont need much accuracy for those areas, but you might want to place them there anyways, as it makes reflections on characters match the environment, and, it makes specular more accurate.
          This is actually really helpful! Thank you so much

          Comment


            #6
            Originally posted by BalseiroFTS View Post

            This is actually really helpful! Thank you so much
            Keep in mind that all isnt written in stone, but, its something useful to work off of, these aren't rules, these are only a foundation to build off of, place them wherever it just looks right.

            Comment

            Working...
            X