-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Addresses issue #6587 #6665
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
Draft
Garima3110
wants to merge
37
commits into
processing:main
Choose a base branch
from
Garima3110:cubeMap
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Addresses issue #6587 #6665
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
227fe69
Extending p5.texture for cubemap textures
Garima3110 8e2d05c
Merge remote-tracking branch 'upstream/main' into cubeMap
Garima3110 317d915
Merge remote-tracking branch 'upstream/main' into cubeMap
Garima3110 917de2f
Added vertex and fragment shaders for cubemaps
Garima3110 5139c0a
Updated src/webgl/shaders/lighting.glsl file for cubemaps
Garima3110 45e33d5
Storing the diffuse irradiance in a cubemap texture
Garima3110 1d54fad
Added caching mechanism for shaders
Garima3110 1ff8702
Updated caching for some shaders
Garima3110 6cd7856
Updated p5.Texture.js
Garima3110 4401ebd
Updated cubeVertex and cubeFragment shaders
Garima3110 37751d9
renamed cubemap shader files
Garima3110 93b8b50
Updated p5.RendererGL.js
Garima3110 66dc0dc
Updated p5.Texture.js
Garima3110 cffda69
Updated lighting.glsl
Garima3110 751b16a
Added TEXTURE_CUBE
Garima3110 29e7a14
Added gl.SAMPLER_CUBE uniform type to p5.Shader.js
Garima3110 7981fdc
Merge remote-tracking branch 'upstream/main' into cubeMap
Garima3110 e7cd392
Minor changes in SAMPLER_CUBE uniform type
Garima3110 f30af0e
Minor updates on caching shaders
Garima3110 d51c4a8
Merge branch 'processing:main' into cubeMap
Garima3110 38bcaab
Merge branch 'processing:main' into cubeMap
Garima3110 2558755
Merge remote-tracking branch 'upstream/main' into cubeMap
Garima3110 773198a
Updated RendererGL.js
Garima3110 bbc7c72
Merge remote-tracking branch 'upstream/main' into cubeMap
Garima3110 ffd9097
Reordered some code in p5.RendererGL.js
Garima3110 cc77e7e
Minor fixes
Garima3110 518b0f0
Merge remote-tracking branch 'upstream/main' into cubeMap
Garima3110 c124738
Fragment shader error fixed
Garima3110 38e6e84
Merge remote-tracking branch 'upstream/main' into cubeMap
Garima3110 a585ef5
Minor updates
Garima3110 f118a3b
some fixes
Garima3110 2da03d1
Merge branch 'processing:main' into cubeMap
Garima3110 5961be8
Minor changes
Garima3110 4515c09
Some changes with cubemap implementation
Garima3110 be6d27f
Minor changes
Garima3110 6dc9916
fix
Garima3110 3133e80
Merge branch 'processing:main' into cubeMap
Garima3110 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Minor changes
- Loading branch information
commit be6d27f6c345046a99f1a9dd1e8d2fc707488ab4
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,13 @@ | ||
| // Adapted from: https://learnopengl.com/PBR/IBL/Diffuse-irradiance | ||
| layout (location = 0) IN vec3 aPos; | ||
| layout (location = 0) IN vec3 aPosition; | ||
|
|
||
| OUT vec3 localPos; | ||
|
|
||
| uniform mat4 projection; | ||
| uniform mat4 view; | ||
| uniform mat4 uProjectionMatrix; | ||
| uniform mat4 uModelViewMatrix; | ||
|
|
||
| void main() | ||
| { | ||
| localPos = aPos; | ||
| gl_Position = projection * view * vec4(localPos, 1.0); | ||
| localPos = aPosition; | ||
| gl_Position = uProjectionMatrix * uModelViewMatrix * vec4(localPos, 1.0); | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, but I feel like do we actually need this layout(). Can it be done just with
IN vec3 aPosition;There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well honestly speaking , I'm also not sure about what exactly it signifies here, but as i searched on web , I found this
If your application code (typically written in a language like C++ or JavaScript) explicitly binds attribute locations using
glBindAttribLocation, you can omit thelayout(location = 0)in the shader. The application code would look something like this:If your application does not do this, you should keep
layout(location = 0)to ensure that the attribute location is explicitly defined.Also , just to mention , I tried running the test sketch by omitting this, and the results were similar , So I think we should keep it for a safer side as its not causing any error.
What say?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this should not give any errors. Since, vertex shaders are just dealing with the positions, I think we don't have layout(...) at other files and they are working perfectly.
But the main reason in my mind is, since we only use
layoutwithinwe can't use it withattributes, where I think islayoutused only for webgl-2? If that the case,layoutshould be omitted.