Page 1 of 1

Glossy Reflection Shader for ShaderLab

Posted: 12 Sep 2015, 08:10
by cthulhu
UPDATE: More recent version and sample pics. Added functionality for glossy reflection and translucency.

:bananahi:

Hello, all. I've been away for a while, but still dabble in trueSpace from time to time.

Here's a glossy reflection shader for ShaderLab I'm working on. Thought I'd post a draft version of it that seems to be working good.

Be sure to set the following raytrace options when using the shader:
Reflect = 0.01
Ray Limit = 0.01
Max Depth = 2 or greater
Glossy 5.zip
(4.81 KiB) Downloaded 130 times
glossysample.png
glossy.png

Re: Glossy Reflection Shader for ShaderLab

Posted: 12 Sep 2015, 10:28
by Cellulo
Thanks cthulhu can i use your shader for my Modelside Edition V2.0 ? also with your old shaders for Shaderlab and shadermagic from old trueSpace forums.

Re: Glossy Reflection Shader for ShaderLab

Posted: 13 Sep 2015, 06:28
by cthulhu
Hi Cellulo. Yes, you may use my shaders.

Re: Glossy Reflection Shader for ShaderLab

Posted: 13 Sep 2015, 19:13
by Cellulo
Thanks cthulhu.

Re: Glossy Reflection Shader for ShaderLab

Posted: 28 Sep 2015, 07:51
by cthulhu
Additional sample images...
glossyglass2.png
translucent.png
glossymetal.png

Re: Glossy Reflection Shader for ShaderLab

Posted: 28 Sep 2015, 10:48
by Cellulo
Thanks for the update cthulhu it's really cool effect.

Re: Glossy Reflection Shader for ShaderLab

Posted: 28 Sep 2015, 13:42
by Draise
Very nice.

Re: Glossy Reflection Shader for ShaderLab

Posted: 04 Mar 2017, 19:17
by cthulhu
UPDATE: Fixed links to images below (hopefully). Also trying to get glossy reflection and refraction working together in one shader.

Been re-working this glossy shader for better speed, but still running into bugs. Thought I'd post a comparison render (straight mirror vs. glossy/brushed look). Brushed metal render was 5 minutes on a 2GHz Intel i7 laptop with 6GB of RAM.

My original shader used an array to hold the blur offset values, but the new shader uses a loop to keep averaging samples together. The original shader used straight random numbers to blur things, but I'm trying a hybrid random+noise function. It can also self-reflect quite well. I hope to post a working, usable shader soon.

Image

Image