GLSL 1.3 and up support

Is it possible to add support to shader using GLSL 1.3 and up?
GLSL v1.2 is quite limited for the implementations of many up-to-date effects.

Thank you

You can bring in features from the newer GLSL versions by defining the #extension that defines the feature.

For example

#extension GL_EXT_gpu_shader4 : enable

I am working on GLSL 3.3 support though.

I have a dumb question on this actually!

If I call noise() in a vert or frag shader Touch tells me that it’s undefined :

gl_FragColor =vec4(noise(gl_Position));

and the info dat says :
0(80) : error C7506: OpenGl does not define the global function noise

now I have to admit I’m a total noob to glsl but if I look at this reference I see a noise function for openGl 1.2 :
opengl.org/sdk/docs/manglsl

Although I do see a lot of people out there defining noise functions from scratch!

sorry… dumb post! I thought the noise function was overloaded to handle different vector sizes but it’s actually just noise1, noise2, noise3, noise4… doh! :blush:

Sadly none of the hardware vendors actually added working noise, that function always returns 0. That’s why people always make their own noise.

ahh… that explains those black pixels then! Ok, I know what to do now, thanks :wink:

so following up on this, if I grab one of the nice simplex noise functions described here:
github.com/ashima/webgl-noise

and apply it with a rest attribute in a frag shader I can start to get something that approaches an fbm noise without anti aliasing. Quite a way to go still!

I’m just wondering, given that there’s already a bunch of clever Touch glsl functions to do cool things and there’s lots of noise functions used in the Noise TOP, would it not be fairly trivial to expose those noise functions in the glsl context?
glslNoiseTest.4.toe (8.6 KB)

Good idea, I’ll add the noise functions to the GLSL 3.3 support I’m adding.

Hey that’s fantastic, I’m sure everyone will benefit hugely from it! :slight_smile: