Rastar Posted February 10, 2015 Share Posted February 10, 2015 I would like to stuff an additional parameter into the G buffer. The only place I can thin of (without adding an additional texture like fragData3) is to encode the normals compress the normals to two channels and reconstruct the in the lighting shaders. However, I can't seem to get this working without artifacts, and I am unsure if this is due to the compression algorithms. Question: Is the normals texture (fragData1) 8bit per channel or 16bit per channel? Could the multisampling somehow get in my way here? Quote Link to comment Share on other sites More sharing options...
Josh Posted February 10, 2015 Share Posted February 10, 2015 The normal texture is 8 bits per channel. The BFN texture is used to encode a compressed normal. You can extract the z component with the X and Y but you will not have a sign for the value. Sometimes you actually want normals that face away from the camera, like for palm tree fronds. I supposed it would be possible to encode the sign of the z component of the normal in an extra bitwise flag for the material properties, and thus free up that extra channel for new data. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
shadmar Posted February 10, 2015 Share Posted February 10, 2015 Going for specular gloss power Rastar? Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Rastar Posted February 10, 2015 Author Share Posted February 10, 2015 Actually, going for PBR ;-) - so in a sense yes, but storing metalness and roughness. Quote Link to comment Share on other sites More sharing options...
Rastar Posted February 10, 2015 Author Share Posted February 10, 2015 Ahhh, got it... It's better to kick out the y component and store xz, since that is usually the largest component of a normal (since it's mostly pointing upwards) and therefore introduces a large error if stored with one of the smaller ones. Quote Link to comment Share on other sites More sharing options...
shadmar Posted February 10, 2015 Share Posted February 10, 2015 Well, you can change the emission shaders, a abit, you will only loose some color control over emission Pack emission color in one float, leaving fragData2 green and blue channel free. In the model shaders for emission: vec3 e = texture(texture4,ex_texcoords0).rgb; fragData2 = vec4(((e.r+e.g+e.b)/3),metalness,roughness,materialflags/255.0); all other model shaders: fragData2 = vec4(0,metalness,roughness,materialflags/255.0); and lighting shaders just add this below where emission is sampled : float metalness = emission.g; float roughness = emission.b; emission.rgb = emission.r*diffuse.rgb; Ofcource, your diffuse have to colorize the emission now instead of the emission texture. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Rastar Posted February 11, 2015 Author Share Posted February 11, 2015 Hej shadmar, thanks fpr the tip! Yes, that would work, although I actually just need one single extra channel since I can reuse the specularity in the normal's alpha. I got the normal compression working for the non-BFN case (looking OK, though I guess some additional bits in the normal buffer would help), still having artifacts for BFN and not don't understand why, but I won't budge... ;-) Quote Link to comment Share on other sites More sharing options...
YouGroove Posted February 12, 2015 Share Posted February 12, 2015 I can reuse the specularity in the normal's alpha There is no more specular in PBR, only roughness and metalness combinations , i you are tempting some PBR system. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Rastar Posted February 12, 2015 Author Share Posted February 12, 2015 There is no more specular in PBR, only roughness and metalness combinations , i you are tempting some PBR system. Yes, I know, what I meant is that I can reuse that channel to either store roughness or metalness. By the way, I finally understood how the best fit normals work, and I guess that means I can't compress those to two channels since the vectors aren't normalized. So I'll probably go ahead and just store the metalness in the upper 6 bits of the material flags channels, since that value is usually 0 or 1 anyways. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted February 12, 2015 Share Posted February 12, 2015 Metalness is not 0 or 1, but something varying from 0 to 100%. Roughness = 15% Metal = 100% : it looks like a non reflective metal with low specular Roughness = 15% Metal = 0% : it looks like rubber Yes, I know, what I meant is that I can reuse that channel to either store roughness or metalness. It depends if your software is able to store some metal or roughness on the Alpha. Substance Painter has many export options while 3D Coat simply uses plain bitmaps without using alpha. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
ChrisV Posted February 12, 2015 Share Posted February 12, 2015 There is no more specular in PBR, only roughness and metalness combinations , i you are tempting some PBR system. Not true, YouGroove. Specularity is still used in PBR. Gloss or roughness maps define the microsurface of the material (and determine how rough or smooth a surface is), and do not replace a specular intensity map. You can either have a specular or a metalness workflow for PBR. Depending on which one you use (or the engine you work with uses), your texture maps will differ. Quote My Artwork. ZBrush 4R7 64-bit - 3DCoat 4.5 BETA 12 - Fl Studio 12 64Bit - LE 3.2 Indie version - Truespace 7 - Blender 2.71 - iClone 5.51 Pro - iClone 3DXChange 5.51 pipeline - Kontakt 5 - Bryce 7 - UU3D Pro - Substance Designer/Painter - Shadermap 3 - PaintShop Photo Pro X7 - Hexagon - Audacity - Gimp 2.8 - Vue 2015 - Reaktor 5 - Guitar Rig 5 - Bitmap2Material 3 Link to comment Share on other sites More sharing options...
YouGroove Posted February 12, 2015 Share Posted February 12, 2015 I'm someone very practical , less theoric I use 3D coat and Substance painter : main PBR methods are roughness and metalness, i like that way of working as i can create any variety of surface, more roughness and less metalness will be visible but will keep a metal effect. What matters is that you find the method that suits you, if you prefer specular go for it. I was mainly pointing that metalness is not 0 or 1 but a variation between 0 an 1 (black and white bitmap if you understand better) Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Rastar Posted February 13, 2015 Author Share Posted February 13, 2015 Ahh, I see.... I guess we're referring to different things here: you to DCC applications and textures, me to shaders and the G buffer. The material flags I was mentioning are stored in the alpha channel of the G buffer's fragData2 - per Pixel, not per material. By "0 or 1 anyway" I meant that since I only use 6 bits for metalness it can only have 64 different values but that doesn't hurt so much since it usually is set to 1 (metal) or 0 (insulator). Quote Link to comment Share on other sites More sharing options...
SlipperyBrick Posted February 14, 2015 Share Posted February 14, 2015 I am watching this thread eagerly If you get some sort of PBR would it be something you are willing to share? Quote Link to comment Share on other sites More sharing options...
YouGroove Posted February 14, 2015 Share Posted February 14, 2015 If you get some sort of PBR would it be something you are willing to share? It's not possible i think. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
SlipperyBrick Posted February 14, 2015 Share Posted February 14, 2015 It's not possible i think. Awh, well thats put a damper on that lol. How isn't it possible? Quote Link to comment Share on other sites More sharing options...
Rastar Posted February 14, 2015 Author Share Posted February 14, 2015 I'm actually thinking about making this an item for the commercial workshop. But there's still a lot of work ahead and requires some additional technical features in Leadwerks, so no promises yet... 1 Quote Link to comment Share on other sites More sharing options...
SlipperyBrick Posted February 14, 2015 Share Posted February 14, 2015 If Leadwerks gets PBR I will fight Chuck Norris .... blindfolded! XD 1 Quote Link to comment Share on other sites More sharing options...
AnthonyPython Posted February 14, 2015 Share Posted February 14, 2015 heck yea Rastar Quote OS: Windows 10 Pro CPU: i3-10100 CPU @ 3.60GHz GPU: NVIDIA 2060 Super - 8 GB RAM: 32 GB Link to comment Share on other sites More sharing options...
shadmar Posted February 14, 2015 Share Posted February 14, 2015 If Leadwerks gets PBR I will fight Chuck Norris .... blindfolded! XD You can't fight Chuck Norris, he fights you, he made PBR blindfolded and owns Allegorithmic. 1 Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
AnthonyPython Posted February 14, 2015 Share Posted February 14, 2015 You can't fight Chuck Norris, he fights you, he made PBR blindfolded and owns Allegorithmic. +1 Quote OS: Windows 10 Pro CPU: i3-10100 CPU @ 3.60GHz GPU: NVIDIA 2060 Super - 8 GB RAM: 32 GB Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.