Home Technical Talk

blurred cube map reflections

polycounter lvl 8
Offline / Send Message
beartraps polycounter lvl 8
I was wondering if there is an attribute in game engines to set real-time reflection blur of a cube map? Or must each separate cube map image be manually blurred in Photoshop before you take it into cubemapgen?

As most metal seems to have reflection blur I'd like to figure out the proper way of doing this.

Replies

  • Slum
    Offline / Send Message
    Slum polycounter lvl 18
    in the shader use something like (simplified example) texCUBElod( cubeMap, powermap) to sample from different LODS of a reflection map
  • Eric Chadwick
    But you need to blur the mips in cubemapgen, not in Photoshop. If you blur in Photoshop, you'll get seams along all the edges of the cube.
  • Xoliul
    Offline / Send Message
    Xoliul polycounter lvl 16
    Not many game-engines support that. Unreal can't do it for example. Your best shot in such a case is to have a low and a highres cubemap (two separate assets) and lerp between or just pick one.
  • Eric Chadwick
    Unreal can't force a mip level?
  • AlecMoody
    Offline / Send Message
    AlecMoody ngon master
    But you need to blur the mips in cubemapgen, not in Photoshop. If you blur in Photoshop, you'll get seams along all the edges of the cube.
    You can also use the diffuse specular convolution in HDR shop. If you are building the panos yourself from photo source this can be a good way to go (especially since cubemap gen will load up the cross output from HDR shop) and it also seems to be the best way to blur an HDR cubemap.
  • Xoliul
    Offline / Send Message
    Xoliul polycounter lvl 16
    Unreal can't force a mip level?

    As far as I know, only statically and globally. You can't switch the MIP level with a function. Not even with custom code, since you can't custom code an asset node, which is essentially just the sampling fuction.
  • konstruct
    Offline / Send Message
    konstruct polycounter lvl 18
    I`m pretty sure thats what the exact function of a gloss map *in thoery* should do. The blurred look comes from the surface having a roughness to it. the smoother the surface, the crisper the reflection. This level of surface detail, is usually so small however, that its hard to see in real life, let alone at game res. So this is what the gloss map simulates.

    Chrome for example is basically a mirror, but all metals can be thought of as chrome. When you add surface roughness, in tandem with how its aged, how its oxidized; that's what makes metal come in all shapes and sizes.
  • Xoliul
    Offline / Send Message
    Xoliul polycounter lvl 16
    That's right, konstruct. My shader allows this, reflection blurriness controlled by the glossmap. I don't really know if there's another shader or application that can do this.
  • beartraps
    Offline / Send Message
    beartraps polycounter lvl 8
    Thanks konstruct, I haven't worked with gloss maps, would you normally duplicate your spec map as a gloss map?
  • Synthesizer
    Offline / Send Message
    Synthesizer polycounter lvl 11
    You can do that for quick results, but it's best to define the materials properly. A gloss map can often be fields of solid colour, defining where you have different materials on the model, ex. metal, wood, etc.
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    Konstruct, the trick is that the more 'accurate' you go with stuff like gloss maps versus sharp or blurry cubemaps, the more you loose in terms of artistic freedom. Lets say a game allows the blurry/sharp cubemap approach only. If you want to make a sexy glossy look on the lips of a female character, you would get crazy reflexions (buildings, sky, whatever is in the cubemap) on this area. Even when working on a realistic character, you might not want that kind of noise.

    Anyways! Just my opinion. I know it can be tough when it comes to talking with graphics programmers, "Oh yeah that feature is cool but you know, we might not want to use it because it would look too accurate, huh, okay, letme explain what I mean ..."
  • Xoliul
    Offline / Send Message
    Xoliul polycounter lvl 16
    I think that just depends on the options of your shader. It's not realistic to have so many boolean switches ingame as my shader has (like 20 plus), but you can just have a few different versions. For that reason, Pior, I'd never put cubemap reflections in a character shader if you can't turn it off. But hey that's me, I'm more artist than coder :)
  • arshlevon
    Offline / Send Message
    arshlevon polycounter lvl 18
    pior wrote: »
    Konstruct, the trick is that the more 'accurate' you go with stuff like gloss maps versus sharp or blurry cubemaps, the more you loose in terms of artistic freedom. Lets say a game allows the blurry/sharp cubemap approach only. If you want to make a sexy glossy look on the lips of a female character, you would get crazy reflexions (buildings, sky, whatever is in the cubemap) on this area. Even when working on a realistic character, you might not want that kind of noise.

    Anyways! Just my opinion. I know it can be tough when it comes to talking with graphics programmers, "Oh yeah that feature is cool but you know, we might not want to use it because it would look too accurate, huh, okay, letme explain what I mean ..."

    pior, actually we are doing this and its awesome, we have an attribute called cube map bias and what it does is the less bias you use the more of a hotspot you get and less of a reflection. so at a value of -4 you only see the circles of the lights reflected and not the buildings and stuff so it looks like standard spec. essentially it is just changing the exposure of the cubemap, if its hdr this is pretty easy to do. i find overall it looks much better,. if you have a room with multiple light sources you get realistic hilights. for each shader we can do this and blur the cubemap as much as we want, i find it much more flexible than the traditional method, and the results are just better.
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    Wow that sounds awesome! Great info, thanks for describing it man.
  • konstruct
    Offline / Send Message
    konstruct polycounter lvl 18
    pior wrote: »
    If you want to make a sexy glossy look on the lips of a female character, you would get crazy reflexions (buildings, sky, whatever is in the cubemap) on this area.

    That would depend on the color of your diffuse. If your diffuse is black then yes. The diffuse should operate as a clamp in such situations. Any color on the cube map that isn't brighter than the diffuse, shouldn't show.

    I.E. reflections should never darken anything further than the diffuse color.
    thats why chrome =
    Diffuse : black
    Spec : white
    Gloss : white

    these lips:
    lipsREX2801_468x315.jpg

    Diffuse : pink
    Spec : white
    Gloss : white

    Does that sound right? - crap now i`m second guessing myself. Gonna to some tests when I get a chance
    Also, not sure how things work outside of my proprietary world :P
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    Well I think would make stuff darker, since light is more condensed over a hot spot, theres less brightness around it. Huhhh maybe haha I dunno. (I mean, in reality, looking at the lips example. Obviously in game it doesn't matter, whatever is cheap and fast is good hehe)
  • Xoliul
    Offline / Send Message
    Xoliul polycounter lvl 16
    Reflections are always additive as far as I know?
Sign In or Register to comment.