D3D Scripts

User avatar
Draise
Captain
Posts: 2936
Joined: 21 Sep 2009, 19:33
Type the number ten into the box: 0
Location: Bogota, Colombia
Contact:

Re: D3D Scripts

Post by Draise » 17 May 2016, 17:23

Well.. that's a nice start.

Here is what and how - I think I mentioned earlier - using micronormal maps would work, which is by FAR much faster that processing it in code or nodes into the Environment and specular aspects of the shader. It has NO hit on performance, or none that I know of.

Image

So, using my shader that Stan and I developed for the passes, and with the default secondary normal map I have placed, you can tile it to quite high values. So using the Diffuse value, I inversely influenced the reflectance, and made the normal map stronger and more tiled inversely. So more reflectence, the more tiled (smaller) the micronormalmap would be, also less/more height values accordingly to not distort the environment map too much. Obviously I'd need to finetune the settings and make a single controller that would drive all those values dynamically - but you can achieve that system without much processing... well other than the dynamic aspect of the shader driving those values.

Ultimately I consider roughness to be.. molecular roughness, microscopic.. so why not use the beauty of normal maps on microscopic detail to achive the "blur" roughiness?? No or little visual performance hit. Though, the little normal map can only get so large tiled that you begin to see it's rough detail as not so "microscopic" but noisy..

Ultimately, PBR usually doesn't have a Specular driver, so that would have to be dynamically configured too, to dynamically change it's value with the reflectance/diffuse and Micronormal map values. When.. I have a bit of time and want to do something large or interesting in trueSpace again - I'll develop that. I miss having realtime AO. I will need to work on my false AO lighting rig a bit more.....

clintonman
Captain
Posts: 2240
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: D3D Scripts

Post by clintonman » 18 May 2016, 00:47

Very nice. I think I'll have to borrow that idea. Normalmaps for roughness - that's brilliant!
One limitation of trueSpace is that it uses DX9 and many of the techniques that have come out over the years are based on DX10 and newer. For me it's ok if it runs slowly, the end goal is to have a material that has the same inputs as the Unreal UE4 shaders with a somewhat similar look which is also close to the disney pbr which should make using renderman easier since it also has similar inputs for it's pbr shader.
Clinton Reese

http://clintons3d.com

clintonman
Captain
Posts: 2240
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: D3D Scripts

Post by clintonman » 28 May 2016, 05:07

Still coming along. I can get some results that look like the unreal material editor preview by combining the roughness with a blur. Only drawback is that the blur was slow. The blur has been rewritten and is now 5 times faster than before which is fast enough for what I want to do. The roughness calculation is still slow. Also found out I needed an hdr image and some adjustments to bring the values into range for display. I was using vue 5 to make hdr images and found that the format was hdr but the values were low dynamic range and gave a bad result.
Image shows no roughness reflection. Next roughness of 0.2 with 16 samples. Last image is blur reflection before the roughness is applied.
pbrwblur1.jpg
pbrwblur2.jpg
pbrwblur3.jpg
Clinton Reese

http://clintons3d.com

User avatar
Draise
Captain
Posts: 2936
Joined: 21 Sep 2009, 19:33
Type the number ten into the box: 0
Location: Bogota, Colombia
Contact:

Re: D3D Scripts

Post by Draise » 28 May 2016, 05:19

This middle one made the sun speckle a bit, is.. that supposed to happen?

I'm glad it's 5 times faster! Good work on the optimizing.

clintonman
Captain
Posts: 2240
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: D3D Scripts

Post by clintonman » 28 May 2016, 18:03

Draise wrote:This middle one made the sun speckle a bit, is.. that supposed to happen?

I'm glad it's 5 times faster! Good work on the optimizing.
That's what you get with only 16 samples. The blur is used to hide the low sample count. The 3rd one is the 2nd with a blur.

I have everything worked out for metallic materials and got the truespace and unreal editor viewports giving similar results. Earlier test was comparing tS to the material editor in unreal. One last adjustment was to the tS lights. Setting intensity to 1500 and quadratic to 50 makes the lighting match up.
I'll take a short break now to fix up the other compositing nodes with the 5 times faster technique.
Clinton Reese

http://clintons3d.com

clintonman
Captain
Posts: 2240
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: D3D Scripts

Post by clintonman » 30 May 2016, 18:09

MetalPlastic.jpg
Closer still. Left is metal and right is non-metal both with the same roughness value and base color. Maybe one more session to work out the details, match the unreal look then combine plastic and metal as one material.
Clinton Reese

http://clintons3d.com

User avatar
Draise
Captain
Posts: 2936
Joined: 21 Sep 2009, 19:33
Type the number ten into the box: 0
Location: Bogota, Colombia
Contact:

Re: D3D Scripts

Post by Draise » 30 May 2016, 18:29

Looking good!!!!!

I think you are forgetting the Fresnel on the Diffuse on the Metalic shader though?

Here are some good reads up on PBR that I base my.. stuff off sometimes. Link 1 and Link 2

clintonman
Captain
Posts: 2240
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: D3D Scripts

Post by clintonman » 31 May 2016, 14:56

Thanks, I'll look into it. Could be because I'm faking it with small sample count + blur.
Clinton Reese

http://clintons3d.com

Post Reply