Jump to content

Simple VEX shaders without functions like "get_bsdf"


fatboYYY

Recommended Posts

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...