I was looking for a way to make an Unreal Engine 4 material for trueSpace workspace and found the fx files in the scripts folder. I did a test and altered the bloom effect. I modified it so it only blurs horizontally.
Image below shows the result, the default blur and bloom unchecked. It may be possible to add post process effects like blur, glow, distortions, fog
I also found what I was looking for in the cook-torrance fx file. I made a copy gave it new description, name and guid. Can load it via script command
D3DView.ImportBrick("C:\\trueSpace761Std\\Scripts\\MaterialEditor\\Bricks\\Compound\\CookTorrance3.Brick.xml",Space.CurrentScene());
For this one I would liek to add an environment reflection and maybe alter it to use the newer GGX instead of Beckmann distribution
D3D Scripts
- clintonman
- Captain
- Posts: 5430
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
- Draise
- Captain
- Posts: 3198
- Joined: 21 Sep 2009, 19:33
- Type the number ten into the box: 0
- Location: Bogota, Colombia
- Contact:
Re: D3D Scripts
Oh Beautiful!
Yeah, I was thinking and started documenting what I would need to create a PBR shader - or how I would make a script to make cubemap or spherical reflection probles to the environment map using the camera projection trueSpace comes with.
I also was experimenting on Micro Normal maps to alter the "roughness" of reflections and things. I can see potential in trueSpace, because a micronormal map is really small and you can tile it to the thousands, ultimately creating the diffused roughness you would see on most PBR materials. I haven't sat down and developed anything at all - but I'm SO happy that you too have similar ideas and that you actually ARE making something happen with it!
Love the new bloom/blur effects you are doing.
Yeah, I was thinking and started documenting what I would need to create a PBR shader - or how I would make a script to make cubemap or spherical reflection probles to the environment map using the camera projection trueSpace comes with.
I also was experimenting on Micro Normal maps to alter the "roughness" of reflections and things. I can see potential in trueSpace, because a micronormal map is really small and you can tile it to the thousands, ultimately creating the diffused roughness you would see on most PBR materials. I haven't sat down and developed anything at all - but I'm SO happy that you too have similar ideas and that you actually ARE making something happen with it!
Love the new bloom/blur effects you are doing.
- clintonman
- Captain
- Posts: 5430
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: D3D Scripts
Thanks, I looked at the bloom and it looks like only the final image is available by bloom time and there's no way to add more controls. So I think the final bloom will have options for alpha, blur and glow by using the existing controls with filtered values so a value of 100.1 will become a value of 0.1 and the 100 will mean "do alpha pass".
Here's the alpha I came up with. It doesn't work with the background color so there is a sphere with alpha value surrounding the scene. Funny that the wireframe grid shows and you can see the semi-transparent navigation widget. I think for non-metals the PBR will be "easy". There is a youtube video for showing how it's done with Blender.
https://www.youtube.com/watch?v=8HMS1MG ... WL&index=3" onclick="window.open(this.href);return false;
PBR is useful for matching Unreal, but also good for matching rendermans pixar shaders.
Here's the alpha I came up with. It doesn't work with the background color so there is a sphere with alpha value surrounding the scene. Funny that the wireframe grid shows and you can see the semi-transparent navigation widget. I think for non-metals the PBR will be "easy". There is a youtube video for showing how it's done with Blender.
https://www.youtube.com/watch?v=8HMS1MG ... WL&index=3" onclick="window.open(this.href);return false;
PBR is useful for matching Unreal, but also good for matching rendermans pixar shaders.
- clintonman
- Captain
- Posts: 5430
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: D3D Scripts
Here it is, the final result.
Post Process settings:
set Scene Intensity to 100 to get only the bloom, which is really a blur
Bloom Intensity, Smoothness and Downsample are still active
set Scene Intensity to 200 to get alpha values as gray color
any Scene Intensity value below 100 will behave the same as before
Installation:
copy or rename
C:\trueSpace761Std\Scripts\D3D\RsD3DBloomFilter.fx so you have the option of going back to the original behavior
unzip and copy the new RsD3DBloomFilter.fx in it's place
restart truespace
Post Process settings:
set Scene Intensity to 100 to get only the bloom, which is really a blur
Bloom Intensity, Smoothness and Downsample are still active
set Scene Intensity to 200 to get alpha values as gray color
any Scene Intensity value below 100 will behave the same as before
Installation:
copy or rename
C:\trueSpace761Std\Scripts\D3D\RsD3DBloomFilter.fx so you have the option of going back to the original behavior
unzip and copy the new RsD3DBloomFilter.fx in it's place
restart truespace
- Attachments
-
- RsD3DBloomFilter.zip
- (1.29 KiB) Downloaded 245 times
- Draise
- Captain
- Posts: 3198
- Joined: 21 Sep 2009, 19:33
- Type the number ten into the box: 0
- Location: Bogota, Colombia
- Contact:
Re: D3D Scripts
Wow, nice.. So..... do you think the same blurry Postprocess can be plugged into a Camera Texture Projector?
- clintonman
- Captain
- Posts: 5430
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: D3D Scripts
I think that would work using HLSL shader bricks.Draise wrote:Wow, nice.. So..... do you think the same blurry Postprocess can be plugged into a Camera Texture Projector?
Here's a picture using the blur from my compositing nodes. It runs too slow and is a bit finicky. The tS post process also uses a simplified faster blur. HLSL using the faster blur should work well.
- Draise
- Captain
- Posts: 3198
- Joined: 21 Sep 2009, 19:33
- Type the number ten into the box: 0
- Location: Bogota, Colombia
- Contact:
Re: D3D Scripts
I have used your blur HLSL brick before, it can be a bit slow yes. I guess the post-process brick could be replaced with your new one that you just made for the faster blur.
- clintonman
- Captain
- Posts: 5430
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: D3D Scripts
Almost...Draise wrote:I have used your blur HLSL brick before, it can be a bit slow yes. I guess the post-process brick could be replaced with your new one that you just made for the faster blur.
The post process lives outside truespace in .fx file, so it only works with the bloom. The good news is that the commands in the fx file are close to what's needed to make a HLSL brick. My blur node doesn't use HLSL code, it's C++. I think an HLSL will be faster because it runs on the gpu. We'll see, I plan to throw together a blur script now.
- clintonman
- Captain
- Posts: 5430
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: D3D Scripts
Not as easy as I thought. The fx file can process the image in passes, meaning it can feed the resulting image into the next step. The HLSL brick only does one pass. If the full image can be stored in HLSL then simulating multiple passes is possible otherwise it isn't. Next I'll see if I can adapt my blur node code from C++ to HLSL.
Image shows blur in horizontal. A second pass in vertical is needed to complete the effect. A blurplane mesh is attached here. Add to a scene and hook up the image. No UI, not user friendly and no clue what good values can be used yet.
Image shows blur in horizontal. A second pass in vertical is needed to complete the effect. A blurplane mesh is attached here. Add to a scene and hook up the image. No UI, not user friendly and no clue what good values can be used yet.
- Attachments
-
- BlurPlane.zip
- (26.58 KiB) Downloaded 252 times
- clintonman
- Captain
- Posts: 5430
- Joined: 21 May 2009, 21:08
- Type the number ten into the box: 0
- Location: California
- Contact:
Re: D3D Scripts
First results of "pbr" material. Left sphere has a little bit of roughness and the right has more. The material uses 16 samples of the image at each pixel and runs slowly. I tried 64 samples and tS couldn't handle it. For comparison the source code I found had 128 samples and another had 1024 samples. The code isn't designed for speed. The roughness randomizer also uses very slow code, but it may not be possible to increase it's speed in HLSL so some other solution or hack will be needed. Precomputing some values and storing them in a image is one method of speedup outside of the roughness calculations.