-
Notifications
You must be signed in to change notification settings - Fork 15
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
rendering issue? vertexCount problem? not sure what to call this #6
Comments
That is strange. I don't know what would cause that. What GPU do you have? You're in which browser, what version? The only thing I can think of is the math is getting slightly off from rounding errors but at those number that shouldn't be an issue. Try this to see what happens
? Seeing that you have 2 points on the left is really strange. Although I think this is unrelated shouldn't this
be this?
That looks like my bad but I don't think it's related |
well at the moment I'm too lazy to look into the math here but check this out https://www.vertexshaderart.com/art/Ekz3YzPYcEQyhT2z7/revision/xYCqo3LfbNTdpYBgH If I size the window from time to time I'll see an irregular arrangement like this |
aah, guessing some funky rounding/precision error or something? i'll scale up the grid and play for now :) |
Denormalized numbers? |
I believe the actual nature of your issue may be related to the specifics of the way that you have gone about things. Try taking out the floor() that you are using to make them flatten into the grid, everything ends up on an angle slant which makes me realize there is a natural shifted cadence causing song to loop around add a slightly different point ________________prior reply:
It's effect can be very pronounced in Fragment shaders that use Ray marching techniques, sometimes they will look like total madness in something such as GLSLsandbox.com, and I just change the top statement from mediump to highp and it looks perfect. I haven't been using many integer based values in my GLS of work as of yet so I don't entirely know for certain what the type conversion from Int to float can do, but for certain I have found some very fascinating artifacts due to rounding errors in time driven shaders. Once the time value starts putting its definition in the higher values and dropping least significant bit resolution from the small decimal, camera movement can begin to become shaky and I even left one going long enough that a shadertoy cave became choppy and fragmented, which instantly was fixed by hitting the timer reset button. |
https://www.vertexshaderart.com/art/xsSZN6pMk7iANGyTE |
There is no reason to wrap this
Just
is fine The wrapping BS left over from before WebGL 1.0 shipped and people don't stop using it because they keep copying the old examples 🙄 Also, in a vertex shader, highp is the default so that's not the issue. There's nothing special going on with the setup. This is just prepended in front of your shader code
|
My reason for mentioning the GL_ES wrapper was based around transferring shaders I had made on my ipad to my desktop, I would get errors on the precision line if I wasn't wrapping it. They were also fragment shaders, and I have just recently started working on vertex shaders again after realizing they are obviously better for some things. I had gotten caught up in the whole ShaderToy movement IQ started that "a quad and a frag shader is all you need" which I am glad I entertained, but some of my prior best work was done entirely in vertex shaders on super old hardware they ran fast as hell.. super glad you made a site with audio/vertex.. that was my old entire workflow and I realize now its worth merging the two for best of both worlds :P` |
I see the GL_ES wrapper as including C/C++ in my JavaScript. I wouldn't do this
So similarly I don't put non-WebGL in my WebGL shaders. It's misleading IMO to most WebGL devs who are unlikely to ever touch OpenGL (there's several orders of magnitude more JS programmers than C/C++ programmers) so rather than clutter my code with stuff they'll never use I try to keep it as clean as possible. It gets worse in WebGL2. The first line of the shader must be
And there is no way to but of course you're free to do whatever you want, just explaining my reasoning. |
@greggman Yes, I totally understand, and your reasoning is valid :) My prior post was only to provide information as to why I use the precompiler ifdef, and that it has usefulness still. Though you may be correct that many people retain it due to copy/pasting or referencing older code, some of us are using it intentionally. Or perhaps when you were mentioning "the wrapping BS from before WebGL1.0 shipped ... people keep copying the old examples" you were referring specifically to the examples of your site? I am curious if there has been any advancement in figuring out the cause for the inconsistent point placement that initiated this thread? I had posted a link to my modification to the code removing the instances of floor(), and was wondering if there is an actual issue with some aspect of the site, or if it is a matter of that individual shader being somehow different from the tutorial? Brilliant tutorials by the way, I learned some great new vertex-techniques. Cheers! |
I don't know why. I tried making a sample in JS just to see if the error would stick out but no error there https://jsfiddle.net/greggman/cjt1u905/ Of course JS is using doubles but it's not like the math used in that sample should fail period it seems to me. On the other hand it is doing math that ends up on the border of values. One way to fix it is to add .1 to https://www.vertexshaderart.com/art/Ekz3YzPYcEQyhT2z7/revision/iXKwcqhgZCQnoJQv4 |
|
it's just an array of increasing floats.
up to about 8million they should effectively be ints
|
make that 16 million |
Well, here's the answer https://stackoverflow.com/a/47422761/128511 ps: yes I know the site is down ... working on it 😓 |
Just started looking at the tutorials, there's a weird issue with rendering the grid though. Copied your code exactly to be sure I wasn't doing something silly (though I might still be) - attached an image for you to see - note the bottom left corner.. the line is incomplete
Seems the
vertexCount
doesn't get fed correctly - either of the commented out solutions below work:Hope this isn't me being silly and overlooking something - been trying to figure this out for some time now! (actually its probably better if its me and not a bug ;) )
The text was updated successfully, but these errors were encountered: