Environment maps - Where and a few others

I havn’t played with these too much and wanted to ask a few questions about environment maps.

Suppose you have a room, something like

With walls and floor all around, just a simple pic for the questions. The 4 floor platforms are raised parts of the floor that I want to be reflective (kinda blurry though so can be low ish resolution?).

Would I be wise to make multiple seperate environment maps, so like

One for each of the small cubes, or is it overkill having multiple environment maps? And if so/not, where would I be best placing maps? Nearest the surface that I want to have reflections or at a sort of eye level in game?

I have a shader I use often that has a diffuse overlay layer. Is there any reason why I cannot use a ‘specular map like’ texture to define which parts reflect using the environment map and which don’t?

Also does anyone have any ideas on what resolutions I should be aiming for with environment map textures? I’m using 2k textures where as a max where I need detail in my game, aiming quite high quality wise so not worried about low spec graphics cards.

Definitely at camera level.

Just check it which resolution look good.

1 Like

This looks like what PBR is solving.
Specular map for the reflective parts: check
Light probes with environment maps: check
:slight_smile:

2 Likes

Thanks winhelp. I will just start high and shrink them smaller and smaller I guess.

Ogil can you tell me what PBR would help with here? Do you mean in regards to what I said about using a specular map to block off parts of the environment map?

edit: having looked through the lighting shader I think the specular map already blocks off environment map.

that doesnt sound right (I’m not saying you are wrong, I’m saying if it is doing that, it doesnt sound right to me)

Perhaps I was wrong. I saw this in the shader

#ifdef USE_REFLECTION
            vec4 refColor = Optics_GetEnvColor(m_EnvMap, refVec.xyz);

            // Interpolate light specularity toward reflection color
            // Multiply result by specular map
            specularColor = mix(SpecularSum2 * light.y, refColor, refVec.w) * specularColor;

And I thought if they part of the specular is black then you’d see no environmentmap when multiplying?

you are correct, it looks like zero spec will result in zero envmap

TBH the reflection computation in the lighting shader may be completely wrong…
But yeah as Ogli mentioned what you want to do sounds a lot like the Image Based Lightign use din the PBR shader.