logoalt Hacker News

phkahlerlast Thursday at 5:49 PM5 repliesview on HN

Is there a standard OpenGL (ES3) shader I can drop in a GPLed application that uses a decent (is there a standard?) BRDF similar to Schlick with red,green,blue, and roughness?

I've wanted to add this capability to Solvespace for a while. I did my own implementation with the Fresnel term and it looked OK, but I want something "standard" and correct.


Replies

jms55last Thursday at 6:40 PM

There is no standard.

Filament is extremely well documented: https://google.github.io/filament/Filament.html

glTF's PBR stuff is also very well documented and aimed at realtime usage: https://www.khronos.org/gltf/pbr/

OpenPBR is a newer, much more expensive BRDF with a reference implementation written in MaterialX that iirc can compile to glsl https://academysoftwarefoundation.github.io/OpenPBR

Pick one of the BRDFs, add IBL https://bruop.github.io/ibl, and you'll get decent results for visualization applications.

fslothlast Thursday at 10:38 PM

I think most realtime production uses something similar to Disney BRDF when they refer to PBR.

https://media.disneyanimation.com/uploads/production/publica...

I don't think there is a standard as such that would dominate the industry. It's all approximations to give artists parameters to tweak.

IMHO - Being an ex professional CAD person I think PBR is the wrong visual style for most cad though. The main point of shading is to improve the perception of shape and part isolation there. Traditional airbrush based engineering illustration styles are much better reference. So something like Gooch with depth buffer unsharp masking IMHO would be much much more appropriate.

show 1 reply
jayd16yesterday at 4:29 PM

There's no standard and even moving things from one 3D program to another can be a painful process if someone else didn't already build in some sort of conversation.

TinkersWyesterday at 4:57 AM

Even if you have a standard specular & diffuse model, indirect lighting is really important and you can't really just drop that into a shader.

If you want a standard I've go with OpenPBR, it is well documented and looks nice. Just skip the extra layers to begin with(fuzz/coat etc).

Pathogen-Davidlast Thursday at 8:22 PM

You might find value in the glTF sample renderer https://github.com/KhronosGroup/glTF-Sample-Renderer

It won't be plug and play since you'd have to pull out the shaders and make them work in your app, but the implementation supports quite a few material variants. The PBR shader implementation starts in source/Renderer/shaders/pbr.frag