Almightygir Posted March 7, 2017 Posted March 7, 2017 AO shall go into the specular map blue channel. Don't apply it to the albedo. We would loose correct specular color for this.So maps we need for pbr:Albedo RGBA:RGB Albedo ColorA Transparency (optional)Specular RGBR Roughness GrayscaleG Metal MaskB Occlusion (Cavity Occlusion, Ambient Occlusion or a combined one, it doesn't matter, just artists choise)Normal RGBARGB Normal MapA Height Map (optional) Thats material layout right now. Though Occlusion doesn't get handled right now. Will do this when ready with IBL stuff. you should rename the Specular RGB map to something else, Reflective or Microsurface would be better. Specular has an actual defined term in current industry usage. If you're using metal masks (which you are), then reflectivity = lerp(0.04, albedo.rgb, metalmask). if you're using a specular map, then reflectivity == specular.
SomaZ Posted March 7, 2017 Posted March 7, 2017 you should rename the Specular RGB map to something else, Reflective or Microsurface would be better. Specular has an actual defined term in current industry usage. If you're using metal masks (which you are), then reflectivity = lerp(0.04, albedo.rgb, metalmask). if you're using a specular map, then reflectivity == specular.Yea, I'm aware of all of this. I just didn't want to confuse people right now, since most of the people in this forum are not familiar with the pbr workflow and need to learn it from the beginning. I will rename it at some point, but now, I will stick with it.
Tempust85 Posted March 7, 2017 Author Posted March 7, 2017 Well that's why I'm asking such questions, ridiculous or not. I'm a beginner at this stuff, and trying my best to understand and learn. SomaZ likes this
SomaZ Posted March 7, 2017 Posted March 7, 2017 Well that's why I'm asking such questions, ridiculous or not. I'm a beginner at this stuff, and trying my best to understand and learn.Hey, no problem. You do fine. Seriously.When I see questions regarding the renderer, I'm here to answer them. Takes some time to fully understand, or dont get confused on how everything works together, especially when you worked like 10 years with another system. (How long have you been doing 3d stuff DT85?) Tempust85 likes this
Tempust85 Posted March 7, 2017 Author Posted March 7, 2017 I've been mucking with 3d stuff since JKA came out. Only just picked up substance painter though, and it's an older copy. SomaZ likes this
SomaZ Posted March 7, 2017 Posted March 7, 2017 added mip-map convolution with ggx distribution using importance samplingold standart mip mapping code (simply downscaling the image) with pre-filtering (1024 samples) Takes some time to see the differences, for someone whos not knowing, what its supposed to do. But I'm positive that this was the biggest part on getting IBL working in the engine. Tempust85, minilogoguy18 and Ramikad like this
minilogoguy18 Posted March 7, 2017 Posted March 7, 2017 Don't worry about confusing people, I'm reading this expecting it to be explained as a PBR workflow since that's what it is. If I feel lost at any point there's always google lol. SomaZ likes this
Tempust85 Posted March 7, 2017 Author Posted March 7, 2017 @@SomaZ So looking at the code, it looks like for deluxemapping you change $lightmap to $deluxemap in the shaders? I do this, but then I get what looks to be funky colors. Is this normal?
SomaZ Posted March 7, 2017 Posted March 7, 2017 @@SomaZ So looking at the code, it looks like for deluxemapping you change $lightmap to $deluxemap in the shaders? I do this, but then I get what looks to be funky colors. Is this normal?No, you don't need to add anything or change in the shader. Thats how I understand it. Strange colors should be normal. They aren't for showing. Adding them in the shader is just for debugging purposes. Tempust85 likes this
Archangel35757 Posted March 7, 2017 Posted March 7, 2017 so the AO and Cavity maps should be separate channels? What if you used an RBGA?
SomaZ Posted March 7, 2017 Posted March 7, 2017 so the AO and Cavity maps should be separate channels? What if you used an RBGA?no, you can just combine them or take just one. The people at Frostbite, for an example, simply leave the ao completely aside and only use the cavity occlusion. (Thats how I read their "workshop" to get pbr working)
Archangel35757 Posted March 7, 2017 Posted March 7, 2017 no, you can just combine them or take just one. The people at Frostbite, for an example, simply leave the ao completely aside and only use the cavity occlusion. (Thats how I read their "workshop" to get pbr working)But they are not the same thing... right? @@Almightygir - what is most industry practice for AO & Cavity maps? What if AO was in the Blue channel and the Cavity map was in an Alpha channel? I don't know what I'm saying- lol. @@SomaZ - I suggest you just transition all the nomenclature and switch over as Lee suugests now so folks can get used to the new terms. Maybe provide the industry definitions too.
Xycaleth Posted March 7, 2017 Posted March 7, 2017 Here's a really useful doc I found on PBR for artists. It's a bit of a read but I think it covers everything you need to know: https://docs.google.com/document/d/1Fb9_KgCo0noxROKN4iT8ntTbx913e-t4Wc2nMRWPzNk/edit?usp=sharing minilogoguy18 likes this
Almightygir Posted March 7, 2017 Posted March 7, 2017 Here's a really useful doc I found on PBR for artists. It's a bit of a read but I think it covers everything you need to know: https://docs.google.com/document/d/1Fb9_KgCo0noxROKN4iT8ntTbx913e-t4Wc2nMRWPzNk/edit?usp=sharing Also these: https://www.marmoset.co/posts/physically-based-rendering-and-you-can-too/ <--- practical application https://www.marmoset.co/posts/basic-theory-of-physically-based-rendering/ <--- education on PBR theory (very useful to artists, but can get techy) https://www.marmoset.co/posts/pbr-texture-conversion/ <--- if you want to (try to) convert older assets to current gen, may be more work required than what's in the doc though. But they are not the same thing... right? @@Almightygir - what is most industry practice for AO & Cavity maps? What if AO was in the Blue channel and the Cavity map was in an Alpha channel? I don't know what I'm saying- lol. @@SomaZ - I suggest you just transition all the nomenclature and switch over as Lee suugests now so folks can get used to the new terms. Maybe provide the industry definitions too. So the frostbyte guys have a "special" type of AO map, where they make the occlusion angles highly accute, which causes much tighter shadows in the map. They're in practice, the same thing... as in, they both affect the renderer the same way. Why do they do it though? Well, an AO map will usually have large, sweeping shadows (think of like... armpits, or between the legs and stuff). Often the lack of ambient light to these regions is enough to create odd looking shading. So by using cavity occlusion instead, they're limiting the lack of ambiance specifically to areas which have really deep geometric variance. Interestingly, Naughty Dog recently released a paper on Uncharted 4 which can help with this stuff too, by interpolating the baked AO details out at glancing angles. i wrote a blog post on this (have to keep a stupid fucking blog for my masters degree), if anyone wants to read it:https://leedevonaldma.wordpress.com/2017/02/19/keeping-things-unreal/ The math/pseudocode is:float FresnelAO = lerp(1.0, BakedAO, saturate(dot(vertexNomalWorldSpace, ViewDir))); as for nomenclature... It was a jarring switch industry wide, and a lot of people rebelled against it. But it really did make sense to use new terminology (ie: Albedo vs Diffuse, Reflectivity vs Specular) when considering the subtle differences. added mip-map convolution with ggx distribution using importance samplingold standart mip mapping code (simply downscaling the image) with pre-filtering (1024 samples) Takes some time to see the differences, for someone whos not knowing, what its supposed to do. But I'm positive that this was the biggest part on getting IBL working in the engine. Sick! There's definitely something odd going on with the fresnel component though, it gets really really dark at the edges here, when really it should get closer to pure reflection instead. eezstreet, SomaZ and minilogoguy18 like this
Archangel35757 Posted March 7, 2017 Posted March 7, 2017 @@Almightygir... makes sense-- tighten up the AO and let the cavity map handle the grosser areas. But are they kept in separate channels or merged into one texture map?
Almightygir Posted March 7, 2017 Posted March 7, 2017 Since you'd just multiply one with the other in the shader, it makes more sense to do it directly in the texture, to avoid an additional texture call or using a texture channel you could reserve for something else.
Archangel35757 Posted March 7, 2017 Posted March 7, 2017 what happens when the model is dynamically lit underneath (e.g. lights shining up through metal grates-- would that change the effect of cavity maps?
SomaZ Posted March 8, 2017 Posted March 8, 2017 @@Almightygir Fresnel-term is computed by the ioq3 code right now, so chances are high that this is fucked up. Right now I'm trying to pre compute the DFG term in a LUT. Though I can't figure out, where the normal comes from, for the importance sampling in the paper from Epic. They simply use N without mentioning it. This answers your question, if we are using importance sampling in real time or the split-sum aproximation.
Xycaleth Posted March 8, 2017 Posted March 8, 2017 I think N is the direction from the sphere which you are currently integrating over. This might help:https://github.com/knarkowicz/IntegrateDFG SomaZ likes this
SomaZ Posted March 8, 2017 Posted March 8, 2017 Looks like I should do mipmapping and creating the LUT on the cpu. Right now I compute them with OpenGL on the GPU. Hm, that would solve the ugly coding part. I'll rewrite this Part, when its working properly. Ty for the help. Archangel35757 likes this
Almightygir Posted March 8, 2017 Posted March 8, 2017 hey sorry, been at uni all day: Xycaleth is correct.
SomaZ Posted March 10, 2017 Posted March 10, 2017 Curious? Diffuse part is still missing.https://www.youtube.com/watch?v=ABamsOcV4lk Ramikad, Archangel35757, minilogoguy18 and 3 others like this
minilogoguy18 Posted March 10, 2017 Posted March 10, 2017 A single tear just rolled down my cheek... SomaZ likes this
Ramikad Posted March 10, 2017 Posted March 10, 2017 No human word can describe that awesomeness. SomaZ likes this
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now