Home Technical Talk

Why do we use specular instead of reflections?

I have been dwelling on this question for about a month and I wanted to get your insight polycount. Why use a specular map when a reflection cubemap or realtime reflection with a map to blur certain areas based on value (white to dark) would possibly create a more realistic feel to the asset? Because I know that objects dont just shine with 'specularity', it reflects the lights and objects and colors around them and determines the shiny-ness by blurring that reflection based on material and surface. Is it just because of performance? Just wondering.

Replies

  • Swizzle
    Options
    Offline / Send Message
    Swizzle polycounter lvl 15
    Realtime reflections are expensive. It's possible to use cubemaps for the kind of effect you're talking about, but those introduce their own set of problems. Mainly in that they increase memory overhead since they're just textures.

    If a given engine uses cubemaps for reflections, you'd need two sets if you wanted to do both mirror-like reflections and "specular" reflections; one that's sharp and in focus, and another that's blurred to simulate reflections you'd get on a rough material. This means you have to either render two sets of cubemaps for every location in the game, or you need to render one cubemap for every location in the game and then duplicate it and apply some sort of post-processing to blur it.

    On top of having to render two separate cubemaps, you'd need a shader robust enough to look up two separate cubemaps on the same material if it's on an object with two different material types, such as glass and brushed metal like you might see on a car. This means a larger number of texture lookups and draw calls, slowing performance. In addition, if you have a single object looking up two separate cubemaps, you also run the risk of having them interfere with one another and rendering badly.

    Basically, it's a big ol' can of worms that isn't worth the effort.
  • Av7xrocker97
    Options
    Offline / Send Message
    Gotcha, so I was right, it is simply just because it's just too axing and/or a pain in the arse. Mk, just wondering.
  • arshlevon
    Options
    Offline / Send Message
    arshlevon polycounter lvl 18
    actually i have worked on many games that use cube maps reflections for spec,and duffuse cubemaps for bounce lighting.
    in fact most deferred engines do this. it looks really nice and is better than the old school blinn spec. you dont have to render out separate cube maps because cubemaps have mips, if you want a rougher reflection force the shader to use a lower mip.
  • Swizzle
    Options
    Offline / Send Message
    Swizzle polycounter lvl 15
    OR YOU COULD BE ALL LOGICAL AND USE MIPS











    In older engines this could be a problem, but arshlevon's right. I was kind of spacing out about deferred rendering solutions and just generally having a rather derpy moment.

    ME =

    ueqV3.jpg
  • mixeh
    Options
    Offline / Send Message
    mixeh polycounter lvl 8
    Pretty sure I'm more derp, what do you mean by use cube maps for reflections - are you guys just talking about plugging in a cube map as well as the spec or what? So confused but feel I should really grasp what you guys are talking about lol XD.

    "actually i have worked on many games that use cube maps reflections for spec,and duffuse cubemaps for bounce lighting."

    How would that be achieved in UDK? So I can try figure this all out :/.
  • Eric Chadwick
    Options
    Offline / Send Message
    Some examples of both cubemap reflection and cubemap diffuse.
    http://zellersamuel.wordpress.com/2010/03/06/cubemaps/

    Diffuse cube lighting is basically a quick hack to get soft ambient-style lighting, but it's very static, you need a new cubemap when your character goes inside for example.

    UDK now has better more-accurate methods.
  • mixeh
    Options
    Offline / Send Message
    mixeh polycounter lvl 8
    Thank you Eric.
  • Eric Chadwick
    Options
    Offline / Send Message
    Yeah, it is. I've seen more memory-friendly options for real-time reflections, like dual paraboloid maps (just two additional renders, instead of six). Still, real-time panoramic reflections are generally avoided.

    Commonly games do a planar kind of real-time reflection for stuff like water, and that's just one additional render.
  • Av7xrocker97
    Options
    Offline / Send Message
    Thanks guys so much for the advice and info. I'm guessing that based on what arshlevon said, you really can't have a reflection with multi-material type function, like say a metal sheet with dirt on it - have it use a type of blur map ( not possible?) and make the metal white (no blurring/minimal blur) and have the dirt be black (much blurring so it doesn't reflect much.). It'd kinda be like a standard black+white spec map, but plugged in for blurring, but I'm not sure if a map like this was possible, so that's why for the most part I made this thread.
  • EarthQuake
    Options
    Offline / Send Message
    Image based lighting is very common in games these days, you have a cubemap for ambient diffuse, and a cubemap for specular reflection, point lights are added on top of that using standard specular methods. Your gloss map controls the tightness of the point lights, as well as the blur of the specular reflection cubemap, generally via mipping.

    If you look at 3 Point Shader, Toolbag, Xoliul's shader etc, this is how they work.

    Using IBL isn't generally that much more memory, as ambient cubes are generally very small, like no larger than 32x32x6, and specular is generally fine no larger than 128x128x6, unless you need really sharp reflections for some reason. Generally, every shader in the game will share these textures, and the textures will be streamed in as you move about the level, so really do not have much of a memory overhead to use them.
Sign In or Register to comment.