fatboYYY Posted July 31, 2016 Share Posted July 31, 2016 Hey, I'm unfortunately already back again with couple of more questions around VEX shaders. I've been trying to write simple VEX shaders, but it got rough as soon as I was trying to create BSDF outputs. As a starting point I wanted to create a chromeball with as few lines as possible. Since you can look up the VEX code from VOP nodes I created the chromeball with as few nodes as possible, looked up their VEX code, took what I needed, and adjusted what I needed to adjust. This is how the simplest chromeball shader, that I could come up with, looks like: Quote #include "bsdf.h" surface shop_chrome() { bsdf f; f = get_bsdf("ggx", "reflect", normalize(Ng), normalize(N), normalize(I), set(0,0,0), set(0,0,0), set(1,1,1), 0, 0, 0, 0, 1, 0, 0); F = f; } Unfortunately I had to resort using the get_bsdf function because I could't get the shader to run without it. But since I don't know what is going behind the scenes of that function, I would want to avoid using functions like it. Are there resources out there where I can look up how to create shader attributes like reflection, refraction, sss, bump, displacement with VEX? Hints at how to use/add up reflection/diffuse bsdfs (or similar stuff) in VEX with example would already help a great amount. Thanks again, fatboY Quote 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.