Jump to content
  • Advertisement
Sign in to follow this  
Paul Griffiths

Physically based rendering in GLM?

This topic is 481 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Any code/examples/tutorials of physically based rendering in GLSL/GLM vector library that I can include in my engine, I've searched google but can't find anything.
Don't want it to bee too complicated though.
Thanks.
Edited by paulgriffiths

Share this post


Link to post
Share on other sites
Advertisement

..and the reason you won't find any is that GLM has nothing to do with Physical Base Rendering...

Share this post


Link to post
Share on other sites

..and the reason you won't find any is that GLM has nothing to do with Physical Base Rendering...

 

..and the reason you won't find any is that GLM has nothing to do with Physical Base Rendering...

 

I did say glsl as well.

Share this post


Link to post
Share on other sites
Is there a specific thing that you're looling for code examples of?

PBR is an adjective that can be applied to techniques in almost every category of computer graphics, from shading, BRDFs, light transport, light baking, to shadows...

Share this post


Link to post
Share on other sites

Is there a specific thing that you're looling for code examples of?

PBR is an adjective that can be applied to techniques in almost every category of computer graphics, from shading, BRDFs, light transport, light baking, to shadows...

 

Is there a specific thing that you're looling for code examples of?

PBR is an adjective that can be applied to techniques in almost every category of computer graphics, from shading, BRDFs, light transport, light baking, to shadows...

 

I'm learning so if I like an example then ill implement it.

 

I've found an example for BRDF here, it's in german or something but the code is English: http://www.mathematik.uni-marburg.de/~thormae/lectures/graphics1/graphics_11_1_ger_web.html#1

 

Edit, it's the same as learnopengl.com which I already have.

Edited by paulgriffiths

Share this post


Link to post
Share on other sites

As your first response suggested, your question implies you aren't ready to really look into PBR.  Do you have custom shaders you have made? Have you written a basic lighting equation? If not, then start looking at writing some shaders. PBR is lighting calculation in a shader.

Share this post


Link to post
Share on other sites

As your first response suggested, your question implies you aren't ready to really look into PBR.  Do you have custom shaders you have made? Have you written a basic lighting equation? If not, then start looking at writing some shaders. PBR is lighting calculation in a shader.

Yes I know PBR are implemented with shaders, as you may not of noticed though I said GLSL/GLM. You can't use anthing other than GLSL, though you could use something other than GLM to do the matrix stuff.

 

My engine has multiple lighting, multiple shadows, deferred renderer, normal and parallax mapping and portals too where shadows and light go in and come out the portals, I believe a world first, as you can see in the very bottom image, the portals has light and shadow going in/out.

And I've invented probably the best name for an engine yet, Ill buy the website address then go public with the name.

 

Heres some screen shots of what I have:

 

 

problem.jpg

 

And I invented a new silver and gold, beat that!

 

Don't you think it's the best silver and gold yet without cubemaps?

 

If you do a google search for opengl gold effect or unreal engine gold effect, nothing of any use comes up, at lease not for many pages, I gave up looking.

I did something wrong when mixing code in a shader from different places(online) and it looked a bit like metal, so I thought it was metal so I kept making changes keeping it as metal until it looked like this:

The image below is not what I currently have, it has more color and the gold looks even better.

 

I haven't Included parallax mapping yet though my engine has it.

With parallax mapping, gold bars!

 

The 2 images here with smiley faces are the same texture, I haven't changed it,  only the code.

problem.jpg

 

?Here's what originally had when I thought the code I was trying to add to my engine was metal, I fixed it, kept at it until I now have what I have.

 

problem.jpg

Edited by paulgriffiths

Share this post


Link to post
Share on other sites

There is some discussion of PBR and code on LearnOpenGL.com, which was where I was planning on starting when I get around to trying to code PBR. It's on my agenda but I'm too busy to see straight right now. I've been making PBR models, which is why I would like to learn how to render them in my code. I'm making the models for a class I'm in and so I'm not importing them into any sort of game engine but rather re-importing them back into Blender to render them there.

 

I'm imagining that you want at least two shaders, one metalic and the other dielectric. It's probably possible to combine them into one shader. Not having coded PBR, I'm still a bit uncertain. But it appears that PBR is mostly about doing Fresnel, Cook-Torrence, and making use of an Albedo, Roughness, Metalic, and Normal map for the metalic work flow and Albedo, Roughness, Specular, and Normal maps for the dielectric work flow. Of course, the whole definition is a bit fluid and you can kind of mix and match additional maps for your shader as well. Substance exports an AO map by default that I don't know what to do with in Blender. And you can add additional maps in the output any time you like, or probably even remove the main ones.

 

There is some literature here.

 

Also, for artistic rendering I'm using HDRi environment maps. And it takes me about 10 minutes to render a frame. Even the "real time rendering" in Blender takes about 2 seconds to really form the picture as it becomes less and less grainy. It would be way too laggy for a game. So, I'm uncertain whether a cube map (or many) is used in the lighting for a game engine. I need to import into Unreal or Unity or something and see what it's like there. It might use directional light or something more simple such as that, but then it's not going to come out anywhere remotely as good, especially for metalics or high gloss stuff.

 

All I would know to do is google GLSL PBR and look for code examples like this.

 

I plan on trying to find GLSL code and work backwards from there. Most of the discussion on this is in Calculus notation and I don't know Calculus, but I do know GLSL and C++; so code examples are where it's at for me.

 

EDIT: Just went back and read the thread a bit closer and see you've already got the LearnOpenGL.com stuff. I bookmarked this at some point thinking it might be helpful. Wasn't sure if you had seen this yet:

 

https://github.com/derkreature/IBLBaker

 

And this:

 

https://nbertoa.wordpress.com/2016/01/25/23/

Edited by BBeck

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!