PDA

View Full Version : A self-contained adaptive quality example



kguciek
05-15-2010, 06:52 AM
I've put together a simple adaptive-quality fragment shader example.

The code does not use any external libraries, so it might be educational for those who want to start playing with WebGL.

You can run it from this page: http://guciek.net/en/3d/adaptive_quality_webgl_example

Note that it was specifically meant to be simple!

miroslav_karpis
06-03-2010, 10:49 PM
thanks,..but when I wanted to run I got: Error: Could not compile vertex or fragment shader!. Didnīt investigate it further....

kguciek
06-04-2010, 01:57 AM
thanks,..but when I wanted to run I got: Error: Could not compile vertex or fragment shader!. Didnīt investigate it further....

Could you please write what your browser/OS/graphics card/driver configuration is?

I have tested this example on two NVidia cards and the OSMesa renderer, so you are probably using some other card brand. Thanks.

miroslav_karpis
06-04-2010, 08:51 AM
Could you please write what your browser/OS/graphics card/driver configuration is?

I have tested this example on two NVidia cards and the OSMesa renderer, so you are probably using some other card brand. Thanks.
- macBook(OSX 10.6.3) & NVIDIA GeForce 320M - 256MB: - shader problem in: Minefield(3.7a5pre) and WebKit(4.0.5 (6531.22.7, r60376))

- have tried also on ubuntu(10.04) and chrome - worked well

kguciek
06-05-2010, 03:17 AM
macBook(OSX 10.6.3) & NVIDIA GeForce 320M - 256MB)

Thanks again. Unfortunately, it is not probable that I will have access to Apple computers anytime soon (well, I can only mess with this in an Apple Store, but this would look strange, hahah).

I don't want to pursue you, but if you have time, you might try to remove both functions and calls to them from the fragment shader and see if it works then.

super_eggbert
06-07-2010, 04:01 AM
I've had a quick look at the shaders and it looks like you're missing quite few ".0" of the end of the floats, macs really don't like that. eg:
float angle = dot(normalize(vec3(-10, -10, 10)), normalize(norm));
should be:
float angle = dot(normalize(vec3(-10.0, -10.0, 10.0)), normalize(norm));
Like you I've no mac to test on and I'm forever making that mistake.

kguciek
06-08-2010, 11:55 AM
I've had a quick look at the shaders and it looks like you're missing quite few ".0" of the end of the floats, macs really don't like that.

You are quite right... I've fixed that, so if you could check if it works now...

miroslav_karpis
06-09-2010, 11:14 AM
I've fixed that, so if you could check if it works now...

still not OK:

line 199: - Uncaught TypeError: Cannot call method 'shaders' of null

kguciek
07-30-2010, 03:32 PM
Now I have fixed shader code to pass the newly-introduced validation - maybe this has helped the Mac case? Or changed anything at all?

miroslav_karpis
07-30-2010, 10:48 PM
Now I have fixed shader code to pass the newly-introduced validation - maybe this has helped the Mac case? Or changed anything at all?
running on mac nice and smooth :wink:

kguciek
07-31-2010, 02:18 AM
running on mac nice and smooth :wink:

Happy to hear that! Thank you. So it turns out that this validation thing is useful, there should be less trouble with different platforms now!

gregg
09-16-2010, 02:51 PM
There's still issues. You're using WebGLFloatArray. That is no longer part of the spec. It's been changed to Float32Array. All of the WebGLXXXArray types have changed names.

Looking forward to checking it out once it's fixed :-D

kguciek
09-17-2010, 01:31 PM
@gregg Big thanks for the reminder! This has changed after I last updated this demo.

I fixed it, but I have not yet done any testing on different systems, so at best I can hope this works for you now :)

It will be nice if you write how it worked after the change and what your specs are.