-
Notifications
You must be signed in to change notification settings - Fork 3
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
Handle particle opacity in shader, instead of duplicating in sprite sheet #45
Comments
For the code review: #29 |
I'd say either leave it as-is, or consider separating the stroke and fill into two sections of the sprite map so that opacity can be correctly applied. @AshrafSharf, what would you prefer? |
For now,I would prefer leaving it as it is |
We decided that this solution is great for now, and we can re-evaluate in the future once scenery has broader webgl support. Closing. |
It seems cleaner to generate a sprite sheet with only a single full-opacity copy of each type of particle, and then add opacity as a 3rd vertex attribute for the shader. Opacity would be passed through per-vertex, but would be the same for each vertex of a particle, and would be applied in the fragment shader.
A proposal for the changes to the shaders would be:
Added to the vertex shader:
Added to the fragment shader:
This would need to be added to the existing buffer, or as a new buffer.
I'm available for help and collaboration on this issue, just let me know.
The text was updated successfully, but these errors were encountered: