Skip to content
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

Update shaders_basic_pbr example to work on web #4516

Merged
merged 10 commits into from
Nov 20, 2024
Merged

Conversation

devdad
Copy link
Contributor

@devdad devdad commented Nov 19, 2024

only two file changed are
examples/shaders/shaders_basic_pbr.c
examples/shaders/resources/shaders/glsl100/pbr.fs

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
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 .
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
set GLSL_VERSION            100

set precision highp float;
removed in keyword
fix for loop has to use only constant
changed to GLSL_VERSION            100
update glsl100 shader
set float  precision  to highp
removed keyword  in
change for loop tu use constant value  gives an error
changed to GLSL_VERSION            100
update glsl100 shader
set float  precision  to highp
removed keyword  in
change for loop tu use constant value  gives an error
@raysan5
Copy link
Owner

raysan5 commented Nov 19, 2024

@devdad afair, rpbr.h was not required

@devdad
Copy link
Contributor Author

devdad commented Nov 19, 2024

I am sorry for the mess only 69f1ab8 is relevant rpbr.h , ah I forgot to remove it from my fork.
No it is not required some mess with GitHub I am not sure why it happened I couldn't clean it up. If you want I can close the Pull request and clean it up first.

@raysan5
Copy link
Owner

raysan5 commented Nov 19, 2024

@devdad I think you can remove it with a PR added

@devdad
Copy link
Contributor Author

devdad commented Nov 19, 2024 via email

removed rpbr.h
@devdad
Copy link
Contributor Author

devdad commented Nov 20, 2024

ok done removed !

@raysan5 raysan5 merged commit 6af664c into raysan5:master Nov 20, 2024
14 checks passed
@raysan5
Copy link
Owner

raysan5 commented Nov 20, 2024

@devdad Nice! Thanks for the review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants