PDA

View Full Version : Read Colour Idx From BitMap



FlemsSolo
04-08-2010, 04:30 AM
Hello

I'm just wandering why I can't use my own values in texture2D() like below :

texture2D(uSampler, vec2(0.25, 0.25));

I would like to be able to use colour maps from bitmaps (1D or 2D) in rendering Mandelbrot fractals.

The full Code is take from (https://developer.mozilla.org/samples/w ... index.html (https://developer.mozilla.org/samples/webgl/sample6/index.html))

Can this be done ... Examples AnyOne ??! ...

giles
04-12-2010, 12:13 PM
Hi FlemsSolo,

I'm a bit confused -- is the code that you give not working for you? It looks fine.


Cheers,

Giles

FlemsSolo
04-14-2010, 01:33 PM
Hi Giles

Sorry for not returning so often to look for replies .... And may I just say, that I look in on your LearningWebGL Blog several times a day .... it's a great place for tutorials and news from the WebGl community ... Outstanding work ...

Yes, the referenced code is okay, but if I want to use my own parameters/variables for texture lookup, as for example the following code 'texture2D(uSampler, vec2(0.25, 0.25));' ... I get an error ...

But maybe I should dig a little deeper into OpenGl to see if I can approach the problem from a wider perspective than that of the 'Rookie' ....

Keep up the good work ....

FlemsSolo, The Rotten State Of Denmark :? ....

giles
04-27-2010, 08:58 AM
Hi FlemsSolo,


Sorry for not returning so often to look for replies ....

Sorry for not replying here sooner!


And may I just say, that I look in on your LearningWebGL Blog several times a day .... it's a great place for tutorials and news from the WebGl community ... Outstanding work ...

Thanks!


Yes, the referenced code is okay, but if I want to use my own parameters/variables for texture lookup, as for example the following code 'texture2D(uSampler, vec2(0.25, 0.25));' ... I get an error ...

That sounds odd, I'd certainly expect that to work. What's the exact error message?


Cheers,

Giles