Physically based rendering in games

12357

Replies

  • marks
    Offline / Send Message
    marks polycounter lvl 11
    Xoliul wrote: »
    I don't think you "need" it, but I do agree it makes things a lot more straightforward and easier to work with. Working on every texture channel separately is such an abstract concept, and a big reason why so many (new) artists struggle with texturing.

    Agreed, it isn't "necessary" but imo it is a much, much nicer workflow.
  • almighty_gir
    Offline / Send Message
    almighty_gir sublime tool
    the shader system doesn't need to be complex at all... unless i'm reading your comment wrong?

    the way i see it there are two ways of handling this kind of material system:
    1. the art lead sits down and defines the look of the game by making a batch of say, 100 different material presets. the art team then composite those material presets using masks. then, depending on the engine these are either baked down to a final map (The Order: 1886), or they remain composited in realtime (EU4).
    2. the artists control the various aspects of their material through maps, they would need (from what i would guess).
    Albedo - coloured for dielectrics, black for metallics.
    Base reflectivity - very dark (around 0.04?) for dielectrics, measured colour samples used for the various metals.
    roughness - similar in concept to the gloss we currently use, but less confusing, no sliders etc.
  • leleuxart
    Offline / Send Message
    leleuxart polycounter lvl 7
    EarthQuake wrote: »
    Yeah a big problem is just lack of proper documentation. We (marmoset) don't have any materials specifically related to PBR or anything like that.

    A diffuse / albedo / color map are really the same thing, how much (if any) lighting you have prebaked into this texture is really an art content issue more so than something specific to the shaders in an app like Toolbag or any games engine. I haven't really used directional light in my diffuse textures in years personally. Toolbag's shaders look much better if you do not bake any lighting (other than AO), otherwise you get that "painted on abs" look.

    AO in a separate texture is something that TB1 does not support but TB2 will likely support (as you can do some more advanced stuff with it like mask it where an object receives direct light). There's an AO slot in TB1 but its for a 2nd uv channel thing that barely works.

    A substance/surface/specular/reflectivity map, again all just different names for the same thing. Its a map to set the base reflectivity of the material (some shaders do away with it entirely in favor of gloss map and probably a global reflectivity value). What this texture looks like is again an art content question, if you're creating it logically where more reflective areas on the texture are brighter, that's going to work in TB1, and TB2, and any PBR system that has a base reflectivity map.

    Roughness is just another word for a gloss map, and if black = rough or if black = glossy is just an implementation thing. The big deal with gloss maps and PBR is that rougher areas sample blurrier/dimmer areas of your IBL cube maps (and your dynamic light intensity fades with glossier reflections) because of energy conservation, which is how TB1 works as well.

    I hope that helps clear it up a little.

    Sorry, TB2 is still work in progress so I can't really tell you exactly what is different (as it may change before release). But basically some of the rendering stuff is more sophisticated / based on more accurate shading models etc.

    One thing I can say is that TB2 has screen-space reflections, which rules and means that instead of putting AO into your spec map to mask strange reflections in occluded areas, you get the proper content reflected in those bits, and it looks really good.

    Awesome, thanks for clearing that up for me. I always thought IBL was just part of the PBR and the other part was super precise textures. I've been reading up on PBR since the SF GDC, but your explanation helped me wrap my head around some of the inconsistencies.
  • divi
    Offline / Send Message
    divi polycounter lvl 9
    luke wrote: »
    looks like pbs is coming inthe next cryengine sdk update!

    http://www.crydev.net/viewtopic.php?p=1152910

    CRYENGINE Demo - YouTube


    especially like the part about "this week"
  • Visceral
    divi wrote: »
    especially like the part about "this week"

    We are allready talking about it Here
  • almighty_gir
  • Visceral
  • EarthQuake
    Slum wrote: »
    Nitpick.. It's not physically based rendering, it's physically based shading. We're still doing triangle rasterization even in the next gen :)

    Not according the the graphics programmers that I know, and various published articles that refer to it as PBR.

    Nitpick... Your beard is too short. Do you even wrestle bears?
  • BARDLER
    Offline / Send Message
    BARDLER polycounter lvl 8

    Their servers are getting destroyed. I can't get it to download.
  • joeriv
    Offline / Send Message
    joeriv polycounter lvl 7
    If you want to try out PBR, it's not in yet.

    but just in case, sulkyrobot has posted a mirror.
    http://www.polycount.com/forum/showpost.php?p=1905093&postcount=22
  • BARDLER
    Offline / Send Message
    BARDLER polycounter lvl 8
    joeriv wrote: »
    If you want to try out PBR, it's not in yet.

    but just in case, sulkyrobot has posted a mirror.
    http://www.polycount.com/forum/showpost.php?p=1905093&postcount=22

    hmm that sucks, they made it seem like that would be in this update.
  • Alberto Rdrgz
    Offline / Send Message
    Alberto Rdrgz polycounter lvl 9
    Xoliul wrote: »
    I don't think you "need" it, but I do agree it makes things a lot more straightforward and easier to work with. Working on every texture channel separately is such an abstract concept, and a big reason why so many (new) artists struggle with texturing.

    to get the extra mile and specular break up and range... yeah. but we can agree to disagree. :)

    it's definitely exciting seeing studios moving towards this solution. (brdf, pbr, ibl, etc)

    BARDLER wrote: »
    Their servers are getting destroyed. I can't get it to download.

    soon_meme_collection_640_14.jpg
  • poopipe
    Offline / Send Message
    poopipe quad damage
    BARDLER wrote: »
    So I have been reading up on this stuff, but I am still confused a little bit about the diffuse/albedo map. I understand why you don't bake any lighting into the map, and only use a little bit of the AO. I am confused about why the colors and values in the map are so important, and how they actually effect the rendering.
    This is the image I am confused about.
    Albedo_values.jpg

    Confusion seems to be rife ..

    The only new thing is the specular reflectance / substance map - it will help to think of it as a substance map because it defines the material by describing how reflective the surface is at a given view angle and also affects the colour of the specular highlights.

    You have to use values as defined in the various reference images because they're inputs to some cunning maths - its not a simple value as per your standard phong spec.

    the system makes things more straightforward in the long run. If everyone does it properly you're not stuck balancing specular values for weeks at the end of a project and you dont have to dick about bending values to fit your lightimg. Also theres less parameters to mess with(break) in your shaders..
  • JordanW
    Offline / Send Message
    JordanW sublime tool
    The reason it's good to have a guide for colors and brightness values is you want to remove as much "eyeballing" of values as possible. What may look "correct" to you in a scene where you eyeballed the lighting and materials may result in too bright or (more often) too dark of a material. Imagine you're working in a scene that is overexposed (lighting is very bright) and you tweak your white cement to actually be very dark or grey in the material. Once you put it in a scene with correct lighting and exposure, it'll no longer be white cement, it'll look too dark.

    One recommendation I have is while tweaking materials always have a copy of the mesh you're working on but with neutral gray applied to it, that'll help you make sure your exposure is correct while tweaking the working material. There was once I was tweaking something really complex like skin, nail the look then put it beside a finished/calibrated material and find out it was reflecting too much light. Having a few reference materials helps as well. Like when you're working on assets bring in one you know is finished and correct and make sure they look "right" next to each other.
  • passerby
    Offline / Send Message
    passerby polycounter lvl 8
    JordanW wrote: »
    The reason it's good to have a guide for colors and brightness values is you want to remove as much "eyeballing" of values as possible. What may look "correct" to you in a scene where you eyeballed the lighting and materials may result in too bright or (more often) too dark of a material. Imagine you're working in a scene that is overexposed (lighting is very bright) and you tweak your white cement to actually be very dark or grey in the material. Once you put it in a scene with correct lighting and exposure, it'll no longer be white cement, it'll look too dark.

    One recommendation I have is while tweaking materials always have a copy of the mesh you're working on but with neutral gray applied to it, that'll help you make sure your exposure is correct while tweaking the working material. There was once I was tweaking something really complex like skin, nail the look then put it beside a finished/calibrated material and find out it was reflecting too much light. Having a few reference materials helps as well. Like when you're working on assets bring in one you know is finished and correct and make sure they look "right" next to each other.

    ya because of this i tend to work on normals and lighting first, and flick back and forward between previewing my scene textured, and with just flat grey.

    the detail lighting mode for the ue3 viewport is very usefull for this
  • iniside
    Offline / Send Message
    iniside polycounter lvl 6
    It's good to setup benchmark scene with Macbeth color chart inside. Of course it's still eye balled, but if colors on Macbeth char look ok, in scene we can assume that lighting is as neutral as we can get.
  • BlvdNights
    Offline / Send Message
    BlvdNights polycounter lvl 8
    disregard im a lazy doofus.[ame="
  • almighty_gir
    Offline / Send Message
    almighty_gir sublime tool
    [ame=" Unreal Engine 4 - Layered Materials Demo HD - YouTube[/ame]

    HOOOOLY SHIT!
  • Joopson
    Offline / Send Message
    Joopson Polycount Sponsor
    I want this.

    Opens up whole new vistas of creativity for artists.
  • almighty_gir
    Offline / Send Message
    almighty_gir sublime tool
    i'm working on it in UDK at the moment, should be ready by tomorrow.
  • Vailias
    Offline / Send Message
    Vailias polycounter lvl 14
    I had something.. kinda like this but more brute force with my Angel model from 2011.
    [ame=" Turnaround - more progress - YouTube[/ame]
    [ame=" Turnaround - boots/metal - YouTube[/ame]
    Angel_WIP_10-17-b-sm.jpg

    The whole thing was one material with shading models and properties separated by a greyscale mask. Since I only needed 5 or so material definitions (metal, skin, fabric, leather, lycra) I was able to use a single channel for the material masks with a similar technique to gradient mapping.
    The lycra bodysuit used a Minnaert shading model. The metal portions of the suit all reflected a cube map and non-linearly skewed the colors in the environment map toward the color in their color map.
    Don't remember how I did the skin, but there are better models out there. Mine was always a bit waxy.

    Still though this wasn't a bad start. Would have been better spun off into a set of material functions but hey.

    Should be able to do something similar to the UE4 layered materials with material functions and some masking. It may not run as efficiently (since its all custom brew rather than built right in). Tricky bit is just how you want to make artists make their masks. :)
  • Vailias
    Offline / Send Message
    Vailias polycounter lvl 14
    Angel_MaterialMask.jpg
    Masking methodology, for the curious.
  • almighty_gir
  • gboxentertainment
    Here's a screenshot from my experimental graphics engine (100% dynamic):

    izGKVzC.png

    runs from 30~40 fps @ 1024x768 on a gtx485m depending on how many of the 3 shadow-casting objects I turn on.
  • d1ver
    Offline / Send Message
    d1ver polycounter lvl 12
    Hey there folks!
    Did this last week for everyone interested in PBR:

    Short Version:
    [ame=" Based Rendering for Artists - Recap - YouTube[/ame]
    Longer Version:
    [ame=" Based Rendering for Artists - YouTube[/ame]

    If anything's not clear in there, feel free to ask!
    Cheers
  • Jerc
    Offline / Send Message
    Jerc interpolator
    Great summary, thanks!
  • maze
    believable metal shaders often requires you to have some kind of variance in both the roughness and reflection
    thats true, glossiness or roughness variation as you want to call it does a lot in terms of helping with the illusion, renders like mental ray call it glossiness an others like arnold call it roughness. Which is the inverse, but the same thing.

    for doing roughness maps I do like to create pure black and white maps mapping reflective and less reflective areas of the object and then tweak the values in the shader with a scalar change range. As the map already comes with 0 and 1 values (black and white) is easier to tweak reflection scale and roughness more accurately than putting straighly a map with grey values into the reflection scale and roughness and let it play by itself... I ve yet to see more than 5 % of people doing this right... most people create a reflection and glossiness map out of the blue and because its black and white they think it i ll work fine.... wrong, lookdev from the shader point of view needs to be taken in consideration prior any texture painting, at least for reflection and surface values...

    Also good cgi metals needs complex ior for different kind of metals, arnold and mental ray give access to this for more accurately fresnel, not sure about realtime though... also material blending does a lot for layered materials with different properties...
  • almighty_gir
    Offline / Send Message
    almighty_gir sublime tool
    thing is, with all this new PBR stuff, roughness has to be clamped between 0 - 1. it's not like gloss where you could interpolate your 0-1 texture to be between any two values you like.

    take Marmoset Toolbag as an example, you have a glossiness slider in there, they recommend that you have it set to maximum to allow "the full range of glossiness". the slider caps out at 256, but in reality you could actually make that value higher and have an even greater degree of control over the glossiness of an object.

    that doesn't (or shouldn't) exist with a PBR setup, when you start pushing the roughness value past 0-1 you start getting horrendous artifacts.

    so while i agree that in current realtime systems, sure you should look at the material setup and tweak the gloss as needed... that just simply isn't the case going forward with PBR.

    as for fresnel values, that's actually very easy to do. in the case of UE4 they use the following:
    fresnel = ndoth + (1-ndoth) * pow(2,(-5.55473 * ldoth -6.98316) * ldoth);
    

    all you would need to do is change "ndoth" to a reflectance value, and you're sorted.
  • Drew++
    Offline / Send Message
    Drew++ polycounter lvl 10
    thing is, with all this new PBR stuff, roughness has to be clamped between 0 - 1. it's not like gloss where you could interpolate your 0-1 texture to be between any two values you like.

    take Marmoset Toolbag as an example, you have a glossiness slider in there, they recommend that you have it set to maximum to allow "the full range of glossiness". the slider caps out at 256, but in reality you could actually make that value higher and have an even greater degree of control over the glossiness of an object.

    that doesn't (or shouldn't) exist with a PBR setup, when you start pushing the roughness value past 0-1 you start getting horrendous artifacts.

    so while i agree that in current realtime systems, sure you should look at the material setup and tweak the gloss as needed... that just simply isn't the case going forward with PBR.

    Yeah. This is where the term Specular Power(Gloss) and Roughness are different. If you need to, you convert from a classic specular power, to a roughness value with some simple math. :)
    // Roughness parameter to a Blinn-Phong specular power
    float RoughnessToSpecPower(float m) 
    {
        return 2.0f / (m * m) - 2.0f;
    }
    
    // Blinn-Phong specular power to a roughness parameter
    float SpecPowerToRoughness(float p) 
    {
        return sqrt(2.0f / (p + 2.0f));
    }
    
    // Another quick way to bring roughness value to a specular power ( 0-2048 ) 
    float power = exp2(13.0 * roughness );    
    
    
  • Santewi
    thing is, with all this new PBR stuff, roughness has to be clamped between 0 - 1. it's not like gloss where you could interpolate your 0-1 texture to be between any two values you like.

    take Marmoset Toolbag as an example, you have a glossiness slider in there, they recommend that you have it set to maximum to allow "the full range of glossiness". the slider caps out at 256, but in reality you could actually make that value higher and have an even greater degree of control over the glossiness of an object.

    that doesn't (or shouldn't) exist with a PBR setup, when you start pushing the roughness value past 0-1 you start getting horrendous artifacts.

    so while i agree that in current realtime systems, sure you should look at the material setup and tweak the gloss as needed... that just simply isn't the case going forward with PBR.



    I suppose you're referring to the method posted by maze?

    The way I understood it was that you'd use a mask, which in turn would be used for lerping the min and max roughness values, which could be tweaked per material, allowing you to use the same generic roughness textures for multiple materials.

    At least that's what I had in my older PBR shader, and I'll most likely incorporate that into my new one as it's very flexible and with the right kind of generic textures it could save a ton of memory.
  • leleuxart
    Offline / Send Message
    leleuxart polycounter lvl 7
    I know this hasn't been posted in awhile, and I haven't seen anyone talk about it enough to adopt, but is there anything on the workflow of creating textures for PBR yet? I'm not talking about UE4, but for the other engines and Marmoset, where we have to focus more on Diffuse photographs and remove lighting info and use the proper colors. I think one of the charts by S
  • perna
    Offline / Send Message
    perna quad damage
    lele: As an artist, not much has changed with PBR. Making a texture correctly the classic way and doing it correctly with "PBR" is pretty much identical.

    You won't have to manually emulate energy conservation anymore as that should be done in the shader, and you might be using a mask instead of colored specular, but these are things that your employer or client will inform you about anyway, as everyone has their own implementation of PBR - it's a very lose standard.
  • leleuxart
    Offline / Send Message
    leleuxart polycounter lvl 7
    perna wrote: »
    lele: As an artist, not much has changed with PBR. Making a texture correctly the classic way and doing it correctly with "PBR" is pretty much identical.

    You won't have to manually emulate energy conservation anymore as that should be done in the shader, and you might be using a mask instead of colored specular, but these are things that your employer or client will inform you about anyway, as everyone has their own implementation of PBR - it's a very lose standard.

    Yeah, I was just curious about the Diffuse color mostly. I know more of the specular work will be done with a Physically Based engine, including the Fresnel/reflectance and energy conservation, but those color/specular charts throw me off. I was just wondering if anyone has had to reference them or determine a more accurate Albedo color of a material.

    If anyone has any PBR texture experience they can throw in, feel free.
  • perna
    Offline / Send Message
    perna quad damage
    leleuxart wrote: »
    Yeah, I was just curious about the Diffuse color mostly. I know more of the specular work will be done with a Physically Based engine, including the Fresnel/reflectance and energy conservation, but those color/specular charts throw me off.

    The concept is just to use standardized values. Your employer will tell you which values to use, if any.
  • Santewi
    It depends on the math. I think the lambert diffuse in UE4 was diffuse/pi, so the values will be darker in the UE4 BPR shader than they would be in another shader where you don't divide it by anything (or divide by a different number).

    The technical artists in the project you're working on will most likely tell you what kind of values you need to use.
  • leleuxart
    Offline / Send Message
    leleuxart polycounter lvl 7
    Ah okay, thanks guys. I thought it'd be a little more cohesive. Oh well! :thumbup:
  • perna
    Offline / Send Message
    perna quad damage
    Continuation of http://www.polycount.com/forum/showthread.php?t=126487&page=14 to avoid hijacking the Marmoset Toolbag thread.
    While it's true that impurities exist in most metals which would give some diffuse properties, the impurities in the metal lead to such low BRDF values that they may as well be black anyway, that's the impression i've gotten from the disney BRDF software anyway.

    That's a small and narrow set - and don't even those values show diffuse contributions upwards of 20%?. The traditional method employed by artists is to rely on observational skills. But that takes, well, artistic skill, as opposed to just firmly adhering to some number in a spreadsheet.

    Ask yourself the following:
    -Why does white metal look whiter than other metal?
    -What happens when metal is exposed to the elements (this includes air)?
    -With black diffuse, how do you handle gradual transitions to non-metal without visual artifacts?
    -How would metal with diffuse contribution look different from metal with specular only, and have you not observed such effects in the real world (forget theory for a second)?

    My betters have advised me to stop taking part in the PBR discussions, as quite a lot of people defend their misconceptions with a near religious fervor and often take any effort to help them see things differently as a personal insult, for whatever reason, and it just ends in drama.

    History repeats itself. I remember getting into heated arguments about specular before on these boards where a lot of people thought I was a complete moron for opposing their views that blue skin specular in non-gamma-corrected textures is meant to emulate reflection of the blue sky. Then after some time, majority opinion shifts to the more reasonable. I'm sure that's going to happen again in this case, so it's probably best to wait before getting too involved.

    For now I implore people to not unquestioningly marry a statement in some PDF or a number in some database but actually use their eyes like artists are supposed to do. A shader will never be able to emulate all the physical effects that happen in real-life, so the artist's eye will always be necessary, and even if such a shader did exist, looking correct isn't the same as looking good. Also realize that the pure theoretical metal which is written about in scientific texts is very different from what the layman refers to as metal, which "suffers" greatly from a large number of natural and artificial processes which brings all values out of whack.
    The other thing to consider is that PBR is supposed to make things more consistent, not just more realistic.
    Well, it can be a consequence in some cases, but not an intention. That kind of value control has already been in place with the more enlightened devs, particular Japanese (see MGS2) and in the movie industry long, long before the PBR-craze reared its ugly head. You'll also find posts by me on these forums from years back encouraging such standards, again unrelated to PBR. The best thing about the PBR trend is that a lot of companies that previously made materials haphazardly are finally starting to put some thought into such production, and at that point the finer points of implementation don't matter all too much.

    It's kind of gotten out of hand. I've even seen the use of cube maps for lighting credited to PBR. Look, realtime rendering was ALWAYS physically based. It's gradually gotten more and more so. There's no point now we suddenly have PBR where we didn't before, and the keyword is "based".
    if you get good results 100% of the time by using the "black metal" technique, then why wouldn't you have that as your workflow?

    Hehe - the phrasing forces the answer. If drowning kittens is the best thing to do 100% of the time, then why wouldn't you drown kittens?
  • almighty_gir
    Offline / Send Message
    almighty_gir sublime tool
    i'm ashamed to say i would drown kittens... =/
  • cman2k
    Offline / Send Message
    cman2k polycounter lvl 12
    Poor kitties. For the greater good!
  • chris89
    Offline / Send Message
    chris89 polycounter lvl 10
    perna wrote: »
    blurp

    This, this and this. It's great to hear similar war stories from different people :)

    Really looking forward to seeing what everyone here will make of all this pbr-i-ness, personally i'm very excited.
  • shaderfx
    Offline / Send Message
    shaderfx polycounter lvl 9
    perna wrote: »
    A shader will never be able to emulate all the physical effects that happen in real-life, so the artist's eye will always be necessary, and even if such a shader did exist, looking correct isn't the same as looking good.

    Quoted for agreement.
  • ENODMI
    Offline / Send Message
    ENODMI polycounter lvl 9
    shaderfx wrote: »
    Quoted for agreement.
    Double qouted for double agree
  • cptSwing
    Offline / Send Message
    cptSwing polycounter lvl 8
    Drew++ wrote: »
    I implemented the GGX/Trowbridge-Reitz into my viewport shader, which should be released soon!
    ggx_pbs.png
    I just need some assets/meshes to test it with :P


    So after teasing us with that WIP youtube video for a good while now - where is it? ;)
  • EarthQuake
    We recently put out two tutorials on PBR, its Marmoset Toolbag 2 specific, but many of the concepts are universal.

    PBR Theory
    PBR and you can too!
  • Computron
    Offline / Send Message
    Computron polycounter lvl 7
    cptSwing wrote: »
    So after teasing us with that WIP youtube video for a good while now - where is it? ;)

    yes, where?
  • tynew
    Offline / Send Message
    tynew polycounter lvl 6
    So for the experienced tech artists out there, how would PBR work with destructible environments?
  • Neox
    Offline / Send Message
    Neox ngon master
    tynew wrote: »
    So for the experienced tech artists out there, how would PBR work with destructible environments?

    erm, what?
  • cptSwing
    Offline / Send Message
    cptSwing polycounter lvl 8
    ..It should have absolutely no impact?
  • almighty_gir
    Offline / Send Message
    almighty_gir sublime tool
    i think he could have phrased his question better, i spoke to him on skype last night and although i could think of a couple of solutions to his problem i couldn't figure which would be best so i suggested asking a tech artist.

    What he actually needs to know, is that since image based lighting is a fairly integral part to a physically based setup, How do you handle a situation where your player character might be able to move into a room where the sky outside (and therefor the sky on the cubemap) shouldn't be seen, but then if a hole were to be blown in the wall and the sky can now come in. What do you do to make sure the IBL is "correct" for both instances.
  • EarthQuake
    i think he could have phrased his question better, i spoke to him on skype last night and although i could think of a couple of solutions to his problem i couldn't figure which would be best so i suggested asking a tech artist.

    What he actually needs to know, is that since image based lighting is a fairly integral part to a physically based setup, How do you handle a situation where your player character might be able to move into a room where the sky outside (and therefor the sky on the cubemap) shouldn't be seen, but then if a hole were to be blown in the wall and the sky can now come in. What do you do to make sure the IBL is "correct" for both instances.

    Its a difficult problem and pretty much any traditional method of lighting would have some sort of issues. If you're using lightmaps you'll have major issues too.

    Cube map probes that update in semi-real time would probably be the solution here. Wouldn't need to be every frame or anything. Still would probably be fairly expensive.

    A real time radiosity or occlusion system instead of IBL probes for per-area light would also probably work. eg, geomeric's enlighten.

    Or of course, restricting damageable items so you can't bring down an entire room/building.
12357
Sign In or Register to comment.