I noticed when going through several textures including those from recent Resident Evil games (0, 4 & 5) that they tend to have a good deal of blank space at the right end of the histogram. Basically it appears they've just dropped the brightness a little to push the 'hump' to the left with the highlights tailing out around the centre. I tried a few experiments and found I tended to prefer the look using this method - it seems to help textures suck up a bit more light before blowing out in the max viewport as well. Now this method goes against what I thought was the best method. Riki from eat3d recommends leveling textures as this is logically the best way of getting the whole range without crushing any values. Does anyone know what's technically going on here and why Capcom choose to do this? I'd really be interested to know the science behind this...
Replies
Also if you've got specular highlights they'll help fill in the high end detail.
However all of this is very dependent on your lighting system. Some systems do not like dark textures.
seanEG: so other polycounters are doing it too. Interesting. I agree about your assumption, that's what I thought too but then there does seem to be something to darkening them.
However, when authoring textures it is important to know about levels. Sometimes some of the textures in your scene just don't match up very well, and it could very well be the levels that are giving you more or less contrast in different parts of your scene. Levels can certainly be a valuable tool in that way...just being aware of them and how they can affect your scene can give you another avenue towards keeping a coherent look to your environment.
But again that's in an ideal and congruent world. There's a million other visual factors to consider depending on the material, style and look, and i haven't played either of those games so i dunno.
Just as often the maximum value per channel is clamped at 1.0.
If your texture has a lot of values already toward 1, any post processing brightness will wash out the detail in the textures toward white. However if you push your values darker, but still maintain significant detail in the texture, the post processing will be able to brighten the scene significantly before your textures wash out, and also likely darken the scene some before losing detail to darkness.
cman - Yeah I too am starting to think this is just down to preference/style/engine and there is no rule for leveling all textures
Prophecies - Yeah I agree with you as that's what I do. Its just Riki had mentioned textures should always be leveled (eat3d nextgen texturing tutorial) which he reiterates several times as does by pinning the arrows around the top and bottom of the histogram's hump.
Vailias - interesting points. I haven't looked much into tonemapping in UDK but perhaps that adds another variable?
equil - no we're talking about texture levels (image>adjustments>levels) and the distribution of RGB input/output values.
here's a bit from the UDN about how dark you should make your textures:
http://udn.epicgames.com/Three/Lightmass#Getting the best quality with Lightmass
It shows some pretty good examples.
Epic's methodology is geared towards stylization and getting the most out of their lightmaps. This isn't engine-specific....it's the unique way they achieve their style and quality. edit: I have been corrected - Epic's methodology is purely towards realism, not stylization.
Again, neither right nor wrong, just different means to different ends. Understanding what affect each of these has on your scenes goes a long way towards empowering you to achieve what you want visually.
I don't agree that this is extremely engine specific. While gamma correction/modulation can be a factor to consider, in most engines it can and should be used to correct your final image, not modify it in a drastic way. That's what (artist-controllable) texture levels and color correction are for.
All this levels stuff really just hearkens back to the old days of texture painting. Read some painting tutorials, and they'll speak specifically towards controlling your color palette's hues and values. You still have to be conscious of that stuff, even if you are sourcing your stuff from photos sometimes....
A friend of mine insisted on this about Japanese developers but...
Is it true that console games from Japan, mainly Square-Enix and Capcom DON'T use normal maps? That's got to be fiction...I even looked at the assets in game and they have them unless they're using some completely different method of which I've been unaware of. And no he wasn't joking or being sarcastic and I was like BS...I know if people start reassuring me I will have asked such a stupid question lol
I'd rather get that out of my system now ><
Capcom definitely use normalmaps. They use an engine called MT framework.
http://www.andriasang.com/e/blog/2010/09/13/3ds_mt_framework_detailed/
I tried copying their example images into photoshop to see if I could replicate their results. The second image doesn't seem to give a value of 0.08 at all (even looking at their histogram screegrabs I can't see where they got that value). The second image has a median value of 65 (65/255=0.22). I must be missing something.
Is there an equation for calculating these figures? I can see the first image's hump is skewed to a higher key and the second is in the low range so i'm guessing they're saying that for Lightmass its best to keep textures in the mid range (and that with gamma in mind, this means slightly towards the high end). Most importantly they iterate the obvious - to keep extremes of bright and dark values to a minimum by creating low contrast diffuse maps to let the lighting engine with spec/gloss/normals to do the work.
.22 in gamma space is the roughly the same as .08 in linear space. so far as i remember to reverse gamma you multiply by (1/gamma).
so 1/2.2 = .454
0.22 * 0.454 = .09
working between linear and gamma spaces is a total mindfuck
I dont know why they are talking about linear and gamma values. This stuff should be transparent to the user. perhaps the screengrabs are linear.
I believe you have the jist of it though. midrange values in the texture allow for broader ranges in shading.
The easiest test is to create an image with every other pixel being black and white, then put what photoshop says is 50% grey (127,127,127) beside it. Notice what photoshop says is "halfway" between white and black is actually WAY darker than the image with every other pixel alternating black and white. What is actually 50% grey in photoshop is 186.
Cman2k, our methodology about brightness of textures is not a stylization. The UDN document is saying if you want realistic lighting and are striving for realistic rendering you should have low contrast, bright textures.
Video game textures tend to be too dark and too saturated with too much lighting painted in. As we get better at rendering GI, dynamic shadows etc, texture artists need to learn to create more physically correct diffuse maps and materials. This is separate from any stylization discussion.
Also to speak to the original issue of RE games having dark textures.
This may have been useful in the past before color grading and GI based lighting. Now if you were to make your textures dark you'll end up making it a pain in the ass to light and color grade. If a surface is already very dark then you can never have any interesting contrast between dark and bright lighting. It really limits your color range. Darkness and mood should be created through good lighting and color grading NOT through textures. (if you're developing for DS or iphone and you dont have nice lighting or colorgrading then you can ignore that)
Could you expand on that a bit more. hows is having a bright low constrast diffuse texture more realistic, surely this is totally dependent on the physical properties of the surface. how do you handle objects with low albedo?
(isnt that what the diffuse map is representing, diffuse reflectance.)
I think I must be misunderstanding something.
I understand the ideal of removing lighting from your textures and making your diffuse absent of as much lighting as possible, so that a good lighting system can do it's work in the most accurate way possible.
What I don't understand is why lower contrast or brighter textures are more realistic? Even in the absence of light, would a surface really be lower in contrast or brighter? This seems counter-intuitive...not saying you are wrong, just not the way my mind thinks of it. I guess I've always thought of a "neutral" texture as having a good balance of lights and darks, at even ends of the spectrum....I dunno.
This is why I assumed it was a stylization. I always thought the idea was to OVER-emphasize the effect of your lighting, kind of exaggerating it so that it's more obvious than would be realistic. So that stuff like lighting/shadowing/color-bleeding would all be more apparent. Beauty in contrast, etc.
This page may help, it has some examples:
http://udn.epicgames.com/Three/TakingBetterPhotosForTextures.html
Notice the final image of the skin is extremely low contrast and bright:
Also notice this polarized image of a plant has very little contrast and lighting and is pretty close to what you should expect for diffuse:
I want to gather more practical examples I just havent had the time, if you're interested in this stuff you could read up on the techniques I outlined in the UDN document and take some polarized-light images of different surfaces to see what the diffuse would be.
Doesnt UDK reverse the gamma on load, render linear and then Gamma correct the framebuffer.
Yes.
The gamma comments came from people saying
"sprunghunt: Interesting. Though the point about Photoshop giving values in gamma space is confusing. My version appears to give RGB127 as mid gray and not RGB186"
If people rely on photoshop to tell them what is 50% grey, they will be wrong. Photoshop says something is 50% but it's actually incorrect.
the top left box is what photoshop says is 50% brightness. Bottom left is 186,186,186
once 127/50% grey is gamma reversed its going to be 50% grey in linear space.
if you manually correct it to 187 its going to be 75% grey in linear space.
my brain hurts
When 127/50% grey (in photoshop ) is gamma reversed it ends up being 0.217 in 0-1 space (AKA NOT 50% between 0 and 1 which is where it really matters, in linear space)
When 186/73% grey (in photoshop) in gamma reversed, it ends up being 0.5 in 0-1/linear space.
Gamma conversion is pow(x,2.2) for reference
Thanks for the elaboration, Jordan!
Is there a way to fix this with a custom ICC colour profile for photoshop? Has anyone tried? I've seen this issue before...
Its not photoshop doing it wrong its down to how our eyes perceive light.
Here true linear gradient placed next to a perceptually correct(Gamma)gradient.
This also goes back to the issue I was trying to address earlier. When creating textures you're not painting pictures, you're painting material properties. Some of them just happen to have color and value. As graphics become more "physically" correct you should understand how they work with lighting and rendering. If you fill your envnrionment with what photoshop thinks is 50% grey and then calculate GI it will be very dark. Like you and I said, 50% grey in photoshop is like 20% grey in linear space which means you intend for the surface to bounce 50% of the light. Once the math is done it only bounced 20% light.
Say we have a scale of 0 too 100 units of light. with black on 1 end and white on the other.
If a Monitor is emitting 20 units of light then our eyes perceive that as 50% grey. If you amp it up to 50 units of light we see 80% grey.
Due to this we use a gamma curve so that the monitor knows how to display images in a way that looks right to us. If you got a light meter and read 50% grey off this imaginary monitor it would be our conceptual 20 units of light, not 50.
So when we reverse .5 gamma to .2 linear we are turning the perceptual measurement back into a correct linear one that is suitable for rendering with. once we have done the linear math and the image is rendered we convert back into gamma space so the mathematically correct image becomes perceptually correct to our eyes.
Im sure photoshop is as messy as hell but applying a gamma 'correction' by amping up your greys in photoshop so they become .5 linear is not correct.
If you want .5 gamma to be .5 linear then don't gamma correct the image. the reason 50% is becoming 20% is because of the the correction UDK is making.
This is why you don't gamma correct normal maps or gloss maps.
Because after the lighting/rendering is done you have to convert the image from linear space to gamma space to be displayed on a monitor. If you didn't un-gamma textures stored in gamma space you would then be re-gamma'ing them at the end after rendering and they would be extremely bright.
This guy from Naughty Dog covers gamma a lot on his blog:
http://filmicgames.com/archives/299
To an extent passeryby is right, in the end it just needs to look good. The thing we need to watch out for is artists in the game industry are just now getting experience with Global Illumination and advanced materials. In the past you were painting a texture that represented a lot of material properties and in some cases was a completely unlit texture that represented the full shading of the model. Now you are painting textures that represent material properties and my point is those aren't always going to look good as a texture flat in photoshop.
what I take reservation with using .7 as your midpoint so its reversed to .5 linear. tor effectively removing udks gamma correction and messing up the lighting math.
can't you see that your actually re applying the gamma by doing this.
Sorry, didn't realize you were being facetious.
I'm not messing up UDK's lighting math by texturing the way I've described. If I want a surface to bounce 50% of light I know how to do it and what it should be created as in photoshop, how is that incorrect?
This is not messing with UDK's gamma correction. This is in fact suggested by the graphics programmer who created Lightmass. Just read the UDN page posted earlier called "Getting the best quality with Lightmass".
I think we're beyond the point of this being a useful discussion anymore, and I think examples of texturing and lighting would be extremely useful to anyone curious.
Indeed, thanks for your time dude.I cant reconcile this in my head so I'm going to go and study this stuff a bit more, and stop stinking up the thread.
gamma 2.2 isn't actually a pow(color,2.2) function. the suggested way to convert to linear space is:
"RGB = ((R'G'B' <= 0.03928) ? R'G'B' / 12.92 : pow((R'G'B' + 0.055) / 1.055, 2.4))"
followed by
"Luma = 0.2126 * R + 0.7152 * G + 0.0722 * B"
The ' means prime, and implies that a color is in gamma space. Great! Now you finally get that perfect 50% gray value. Except it's still not really a middle gray. Because the human visual system has different sensitivity for different colors, a perceptually gray pixel would not be a uniformly lit pixel at half intensity, but in fact be green in the real world (the green "subpixel", or led light, would be brighter than the red and blue ones).
Also "middle gray" is not actually 127 or 128, but 119(~47%) in sRGB. that's 50% L in the LAB color space. Strangely enough 50% K in CMYK isn't even gray, but very unsaturated blue. I don't even know how that works.
i have no idea how far this rabbit hole goes but until i see the end i guess i'll just keep falling.
edit: just reading the Naughty Dog GDC link from Jordan. Thank you for the great info!
Just started rooting through this thread again. At the moment I'm using IBL in Unity with Marmoset Skyshop and noticing massive differences depending on levelling. Like others here I prefer to make my textures on the lower end (guess that also allows room for the light to add on top).
I would advise against lowering the levels of your albedo/diffuse maps by half to account for any lighting. You are effectively lowering the light intensity of your scene by half but baking that change into your art content and discarding half the precision of your textures.
If your lighting is too bright in a properly tone-mapped engine (like Unity + Skyshop), change the lights in the level. If you want to boost your specular highlights in contrast to the diffuse lighting, do so with the specular content or use the specular multiplier Skyshop's materials provide.