-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
basic PBR example #3621
basic PBR example #3621
Conversation
pbr implementation includes rpbr.h and few shader files header only file, which self contain everything needed for pbr rendering. Few textures and one model of the car which is under free licence which is included inside basic_pbr.c example file currently supported shader versions are 120 and 330 , version 100 has small issue which I have to resolve
I forgot unloading PBRMaterial
Thank you for this effort |
@devdad Amazing! Thank you very much for all the hard work on this great example! I need some time to review it properly! |
No problem Ray! It was my pleasure. Please ping me if you need anything. |
Thank you Victor! It was much easier because of you! |
value was Vector4 at first but I found out it would be unclear for and users, so I change to have two Vector2 instead, but forgot to assign offset .
@devdad Is the |
How big are the textures included in pixels? I see they add about 15MB to the repo, that's quite big... maybe texture size could be reduced to 1/4, at least some of them? |
Hey Ray can we reduce 1/2 and save it as jpg so it would be good quality and smaller? I will reduce textures, but please keep in mind that these models and textures will be used repeatedly in different examples related to PBR. |
"plane.glb really needed?" Not really, but if we use the GenMeshPlane() we just need to create tangents, it is even better because we will show that we need to generate tangents, otherwise people will be confused why it is not working. |
If width/2 and height/2 it would be reduced to 1/4, JPG would lose image quality so it's ok to keep them as PNG. Considering it would be used for other examples, maybe only some maps of the car/road can be reduced? It would be nice to make some quick test to see if it is really noticeable the change... Also note that this is an example for the users to see how to implement it, finally visual quality is not that important.
That's fine, you can use |
yeah agree I will test. I think it would be still good . |
@devdad I'm checking Also noted that at the moment there is no |
no, for now there is no PBREnvironment but that will come soon IBL, reflection etc. we can use raylib Model and Material but we need to change them a bit, my intention was not to change anything because you already have a lot to do, and PBR can have just about anything in the header, especially since it will be expanded soon |
Changed size of textures from 2048x2048 to 1024x1024 and file name changed to shaders_basic_pbr.c , Added the function PBRModel PBRModelLoadFromMesh(Mesh mesh); but GenMeshPlane(2, 2.0, 3, 3) culdn't be used because it crash once GenMeshTangents() is used with that plane mesh
@raysan5 Hey Ray, I did change everything , I changed texture size to 1024x1024 from 2048x2048 , changed the file name to shaders_basic_pbr.c added function PBRLoadModelFromMesh(Mesh mesh); But I couldn't use GenMeshPlane(2.0,2.0,3,3); because plane crash the function GenMeshTangents(); I didn't have time to investigate why, but I did use before GenMeshTangents() on Loaded meshes and it was working. |
@devdad thank you very much for the addition and the reviews, I'm merging it for further reviews. |
pbr implementation includes rpbr.h and few shader files header only file, which self contain everything needed for pbr rendering. Few textures and one model of the car which is under free licence which is included inside basic_pbr.c example file currently supported shader versions are 120 and 330 , version 100 has small issue which I have to resolve