GLSL PBR Shader for viewport

Same error…

New build is uploaded ! Same link as above

Sorry but I still get the same errors in the console.

I will wait for a Linux build instead, feels like it should work better :stuck_out_tongue:

I’m tracking the issue… please be patient.

Awesome! your build will be the complement for my process of creating games, I’ve done a similar shader but it only works with BGE.https://www.youtube.com/watch?v=3H_QfoaeNys

I found the f***cking issue. It was blender’s GLSL code gen that was not performing a cast. I’m still searching if it’s my fault or a bug.

I tested the build on a GT 560M so it should work for everybody. (Mine is 9800GT. older cards seem to not have that problem apparently it’s NVIDIA drivers fault for being too permissive)

Still same link but hopefully this one will work for everybody.

@Aryok: Yeah i saw your video. But i was wondering if you do have full hdr range in your shader? and if you blur the reflection based on roughness setting?

It works! Thank you for the fix. Now off to play with this :smiley:

EDIT: Okay so this is pretty friggin amazing. You can even create a fresnel effect by adding a “layer weight” node from Cycles. I am pretty sure that I broke the PBR-workflow by doing this and now I can’t figure out a way to adjust the actual roughness of the object separate from the fresnel amount but it looks pretty cool :stuck_out_tongue:


Hi! All PBR shaders seems to work now, but test scene isn’t working.


I have red undefined nodes in all materials except redCoat. Please say how to handle this :slight_smile: Thank you!

ok! cool! Now works very well. Thx for sharing this :wink:

Very cool, I was waiting for such PBR viewport rendering! Really hope that could get into trunk at some point.
You’re using a spec map, is it a RGB reflectance map? What about using a metal mask and get the color from the albedo texture, like the Disney PBR?

EDIT: actually if you’re following marmoset setup, you’ll have the reflectivity map (metal mask) and fresnel map, similar to Disney’s PBR. So forget about my question :slight_smile:

@chafouin : Converting specular / gloss to metalness / roughness is just a matter of a few nodes. I’l add this.

@floo : thank you! please post your results if you can. That will cheer me up. :slight_smile:

@NinthJake : Not sure about what you are trying to do :slight_smile: the fresnel reflection is already calculated inside the IBL Spec and PBR Lighting node. Maybe I’ll add another control for it like in marmoset but it’s only to get rid of the fresnel effect not to overdo it. The fresnel effect is by deffinition (in PBR) bound to the roughness.

But i think if you want to overdo it just multiply the output of the IBL by a fresnel factor. Or add an environement Map node multiply by fresnel and add it to the result (like a coated material).

We need it in Trunk! NOW! :cool:

@hypersomniac I see. That just goes to show that I have no idea what I’m doing lol. I didn’t see any fresnel effect so I thought it wasn’t implemented. Glad to hear it is though, I will continue to play around with it and see what else it can do :slight_smile:

Thank you again for the awesome work!

No, unfortunately my shader does not support full hdr range, I need to do more research in that field, and for blurred reflections I’m using prefiltered cubemaps and it can be controlled with a roughness map, here’s one of my cubemaps.

https://drive.google.com/file/d/0B6peUoeJH_CabDVYOTloUWp2Tkk/edit?usp=sharing

@Aryok : I was facing the same issue with clamped HDR to 1.0. It’s in blender code it clamp to prevent Artifact when generating mipmaps with GLU (not the GPU) So i commented this line (that may not be the best idea). You can see the artifact when unchecking GPU Mipmaps in the system settings using my build.

About the prefiltered cubemap, I’ll add support for them because the generated GPU Mipmap does not account Light distribution so a lot of lighting info is lost.

@oguretz: the 1st example file was meant for the 1st version. I’ll do another one for the next version.

I wish you luck with cubemaps, I had a bad time trying to make it work due to BGE mipmap lacking support with samplerCube. I hope Blender’s core supports it.

I always wished to have something like this for the viewport. It’s just amazing!

Any news about the progress of this project?

Specifically any Linux builds? :stuck_out_tongue: