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

new way for hash generation #180

Merged
merged 2 commits into from
Jan 7, 2019
Merged

new way for hash generation #180

merged 2 commits into from
Jan 7, 2019

Conversation

jcyuan
Copy link
Contributor

@jcyuan jcyuan commented Jan 4, 2019

this is what I found recently, really good one: http://byteblacksmith.com/improvements-to-the-canonical-one-liner-glsl-rand-for-opengl-es-2-0/

so I created this PR to solve the issue I posted before: #170, or perhaps #139 is related too? actually everywhere if you want to use random, please use this hash generator instead of the old one.

changes:

  1. use new way to generate hash, old one does not work on iOS devices
  2. remove the division for pre-multiplied alpha, it's even not enabled before in the for loop, why I need to divide the color by it's alpha at the end? this will cause the pixel too bright.

maybe some other shaders of this project have the old hash method too (it's really common on internet, everywhere....), so you might replace all of them with this new one.

test for changes:
https://jc-space.com/testfilter/test.html?ver=1.1
image

@jcyuan
Copy link
Contributor Author

jcyuan commented Jan 7, 2019

by the way, this piece was already merged into THREE.js official common lib of the shader sys.

test on shadertoy:
https://www.shadertoy.com/view/Wsf3RS

@bigtimebuddy
Copy link
Member

Thanks @jcyuan for fixing this

@bigtimebuddy bigtimebuddy merged commit f521014 into pixijs:master Jan 7, 2019
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