Author : AneeshaRode


Reply
Reply
 
Thread Tools Display Modes
PhobicGunner's Avatar
Old (#1)

Traditionally, 3DS Max has not been very good at previewing what game art will look like in the final game, particularly with the standardization of PBR shading in next-gen engines.
PBRTK is a viewport shader for 3DS Max which solves just that! This viewport shader gives you a physically-based shader based on the metalness workflow in line with next-generation game engines, allowing you to have a much better idea of what your model will look like in the final game.

Some screenshots of the shader are below:




Get it here: http://www.mophogames.com/pbrtk-3ds-...ewport-shader/

Last edited by PhobicGunner; 09-27-2014 at 04:03 PM..
Offline , line, 62 Posts, Join Date Apr 2013,  
   Reply With Quote

gsokol's Avatar
Old (#2)
Cool! So how are you handling reflections then? Do you have a cubemap input? or...?


Also...potential issue here. I see you are working in max 2010. Are you preparing this to work post max 2013 when autodesk decided to screw up the way normals work?
George Sokol
Environment Artist @ Volition
Portfolio
Art Blog

Current WIP: [WIP] [UE4] - Skirmish - scifi corridor
Offline , dedicated polycounter, 1,574 Posts, Join Date Feb 2010, Location Champaign, IL USA Send a message via Skype™ to gsokol  
   Reply With Quote

PhobicGunner's Avatar
Old (#3)
There's two cubemap inputs. One for diffuse ambient IBL, one for specular reflection IBL. Two cubemaps will be included (the diffuse ambient one I just made from the specular reflection cube in Cubemapgen)

How did max screw up the way normals work? >.>
I'm calculating my own tangent basis from the normal, tangent, and binormals.
Offline , line, 62 Posts, Join Date Apr 2013,  
   Reply With Quote

Fwap's Avatar
Old (#4)
Very keen for this!
Offline , triangle, 461 Posts, Join Date Dec 2010, Location Melbourne Send a message via Skype™ to Fwap  
   Reply With Quote

PhobicGunner's Avatar
Old (#5)
Quote:
Originally Posted by Fwap View Post
Very keen for this!
Glad to know there's interest in this
Offline , line, 62 Posts, Join Date Apr 2013,  
   Reply With Quote

Revel's Avatar
Old (#6)
Really interested with this as well!
But I can't seems to see the screenshot posted on your first post?
Offline , triangle, 499 Posts, Join Date Apr 2010, Location Kuala Lumpur, Malaysia  
   Reply With Quote

TheEngineer's Avatar
Old (#7)
i'm interested in using this as well, however i get this in max 15 with the example you provided.

Quote:
CUsers\Dakota\Desktop\Max_scripts\shader\memory( 216,2): error X4000: variable 's' used without having been completely initialized
CUsers\Dakota\Desktop\Max_scripts\shader\memory( 251,16): ID3DXEffectCompiler::CompileEffect: There was an error compiling expression
ID3DXEffectCompiler: Compilation failed
im loading it like i would Xioulin shader so if this is a error on my part my apologies, i know at least one of my buddies would love this kind of option in max aswell.

best of luck i will be following the development of this closely.
Offline , null, 6 Posts, Join Date Jul 2014,  
   Reply With Quote

radiancef0rge's Avatar
Old (#8)
Are you hard coding the multimask to those specific channels or is there an option to change that?
Technical Artist - Firaxis
Offline , triangle, 386 Posts, Join Date Mar 2013,  
   Reply With Quote

PhobicGunner's Avatar
Old (#9)
Quote:
Originally Posted by TheEngineer View Post
i'm interested in using this as well, however i get this in max 15 with the example you provided.
Eh? The example I provided?
Are you talking about the viewport shader template?
Try changing line 213 to this:

Code:
SurfaceOutput s = (SurfaceOutput)0;
Offline , line, 62 Posts, Join Date Apr 2013,  
   Reply With Quote

PhobicGunner's Avatar
Old (#10)
Quote:
Originally Posted by radiancef0rge View Post
Are you hard coding the multimask to those specific channels or is there an option to change that?
Actually, I just changed that yesterday. Now it takes separate images for metalness, ambient occlusion, and roughness. Also, non-metal surfaces are now assumed to be 4% reflective - this was mentioned over on the PBR in Practice page on the Marmoset website, and I went with it as it allows me to drop a full extra texture. It also seems to work just fine in practice.
Offline , line, 62 Posts, Join Date Apr 2013,  
   Reply With Quote

amartinez's Avatar
Old (#11)
Glad to see you are pushing this forward full on : ).

I had a question regarding the 4% (0.04) base reflectivity. Is this the linear value? or the gamma space value? (Same for 30 -50 minimum value on the diffuse, is it 30-50 before or after gamma correction?)

Thanks.
Offline , vertex, 34 Posts, Join Date Aug 2014, Location Montréal  
   Reply With Quote

PhobicGunner's Avatar
Old (#12)
0.04 is the linear space value.
Don't know about the diffuse one. I think it's safe to assume that it's pre-gamma-correction, since generally PBR works/looks best in a linear color space.
Offline , line, 62 Posts, Join Date Apr 2013,  
   Reply With Quote

PhobicGunner's Avatar
Old (#13)
PBRTK version 0.1 is up on my site!
Get it here: http://www.mophogames.com/pbrtk-3ds-...ewport-shader/
Offline , line, 62 Posts, Join Date Apr 2013,  
   Reply With Quote

Obscura's Avatar
Old (#14)
Thanks! Rouhgness works reverse by the way.
- And the cubamep is wrapping strange. I mean it looks ok from the default view, but its coordinates looks buggy when im rotating the camera.

Last edited by Obscura; 09-27-2014 at 05:29 PM..
Offline , polycounter, 979 Posts, Join Date Jan 2011, Location Hungary  
   Reply With Quote

PhobicGunner's Avatar
Old (#15)
Quote:
Originally Posted by Obscura View Post
Thanks! Rouhgness works reverse by the way.
Not necessarily ;)
It's easy enough to change of course. I may add an option to change how roughness works. Until then an easy workaround is just to import your roughness map into Photoshop and hit CTRL+I.
Offline , line, 62 Posts, Join Date Apr 2013,  
   Reply With Quote

PhobicGunner's Avatar
Old (#16)
Quote:
Originally Posted by Obscura View Post
And the cubamep is wrapping strange. I mean it looks ok from the default view, but its coordinates looks buggy when im rotating the camera.
Screenshots?
Offline , line, 62 Posts, Join Date Apr 2013,  
   Reply With Quote

Obscura's Avatar
Old (#17)
Maybe I see it wrong but it has strange distortion.
Offline , polycounter, 979 Posts, Join Date Jan 2011, Location Hungary  
   Reply With Quote

PhobicGunner's Avatar
Old (#18)
Yep, that happens in real life too.



Look at the top of the sphere, notice you can see the ground.

It's actually common to capture an environment for image-based lighting by taking a photograph of a highly reflective ball as seen above.
Offline , line, 62 Posts, Join Date Apr 2013,  
   Reply With Quote

Obscura's Avatar
Old (#19)
I worked with several cubemaps and cubemaps setups inside udk earlier, and I didnt had this strong distortion on the edges. Maybe its something with the with the dimensions of the cubemap(like with a parallax corrected cubemap)?
Offline , polycounter, 979 Posts, Join Date Jan 2011, Location Hungary  
   Reply With Quote

PhobicGunner's Avatar
Old (#20)
I don't know what UDK is doing - it could be they are doing some sort of highly simplified calculation which isn't totally accurate.
All I'm doing is reflecting view direction along surface normal using the built-in reflect function. The result is also realistically plausible as evidenced by many photographs I can find on Google Images, so I don't think it's an issue.

EDIT
Seems UE4 also has results closer to what I have: https://d1wzu4qct23er4.cloudfront.ne...al/banner2.jpg

So I'm assuming it's probably some optimization or approximation in UDK.

Last edited by PhobicGunner; 09-27-2014 at 06:23 PM..
Offline , line, 62 Posts, Join Date Apr 2013,  
   Reply With Quote

TheEngineer's Avatar
Old (#21)
its not installing for me on max 2015, ran as admin and made sure i was running direct X 9, it would be awesome if i could use this in my workflow, if its too much of hassle i would understand though, you pushed out the first version quickly though and your screen grabs look amazing.
Offline , null, 6 Posts, Join Date Jul 2014,  
   Reply With Quote

PhobicGunner's Avatar
Old (#22)
Quote:
Originally Posted by TheEngineer View Post
its not installing for me on max 2015, ran as admin and made sure i was running direct X 9, it would be awesome if i could use this in my workflow, if its too much of hassle i would understand though, you pushed out the first version quickly though and your screen grabs look amazing.
What issue are you encountering? Material doesn't show up in material browser, invisible in viewport, files not installed to correct locations, errors...?
Offline , line, 62 Posts, Join Date Apr 2013,  
   Reply With Quote

TheEngineer's Avatar
Old (#23)
its not doing anything, i dragged the file into the view port, then checked to see if they were going into the directories that were defined in your read me and they weren't created nothing in the start up folder nor in the folder with the other shaders are stored, its like its not running the script nor installing. no dialog pops up for installing nor does it initialize, im not sure whats going on to be honest maybe someone else who has max 2015 could try and see if they are having the same issue?
Offline , null, 6 Posts, Join Date Jul 2014,  
   Reply With Quote

PhobicGunner's Avatar
Old (#24)
Do you have any older versions to test on?
If the MZP file runs at all it should pop up a message box telling you to restart 3DS Max. If it doesn't, then something is definitely wrong.

EDIT
Still, you CAN manually install the files yourself. It's just more of a pain.
To do this, rename the .MZP extension to .ZIP, then extract it. Take the files under res/PBRTK/ and put them into Maps/fx/PBRTK/. Then, take the PBRTKMaterial.ms script under script/ and move that to Scripts/Startup/PBRTK/

Last edited by PhobicGunner; 09-27-2014 at 08:39 PM..
Offline , line, 62 Posts, Join Date Apr 2013,  
   Reply With Quote

gsokol's Avatar
Old (#25)
Quote:
Originally Posted by PhobicGunner View Post
There's two cubemap inputs. One for diffuse ambient IBL, one for specular reflection IBL. Two cubemaps will be included (the diffuse ambient one I just made from the specular reflection cube in Cubemapgen)

How did max screw up the way normals work? >.>
I'm calculating my own tangent basis from the normal, tangent, and binormals.
Oof, sorry for responding late...I was referring to how Nitrous spits out wierd values for tangents/binormals. I really don't know much about it, other than it crippling the xoliul2 shader.

That pretty much killed me ever attempting to use viewport shaders in max ever again, so I haven't bothered messing with any new shaders since.

Sounds like its working fine for other people though, so ignore me
George Sokol
Environment Artist @ Volition
Portfolio
Art Blog

Current WIP: [WIP] [UE4] - Skirmish - scifi corridor
Offline , dedicated polycounter, 1,574 Posts, Join Date Feb 2010, Location Champaign, IL USA Send a message via Skype™ to gsokol  
   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.

Copyright 1998-2014 Polycount