PDA

View Full Version : Webgl Texture



rdheepan
03-24-2012, 11:48 PM
Hi,
I am learning webgl now. When i tried to use texture, nothing was working for me.
I just copied the code from the following link to my machine and tried, but the texture was not working.

https://cvs.khronos.org/svn/repos/regis ... itBox.html (https://cvs.khronos.org/svn/repos/registry/trunk/public/webgl/sdk/demos/webkit/SpiritBox.html)

I also copied the code from some other website and tried. At that time also it was not working for me. I checked the image size all the time. It was power of 2.(like 256x256.. 512x512...)

Could you please tell me what is going wrong here?

Thanks in advance,
Dheepan.

matej
04-11-2012, 11:24 PM
can you run your code on some server or your localhost?
it is possible, that your proble doesnt allow you to use the texture file
when the code is run locally

rdheepan
04-11-2012, 11:34 PM
Hi matej,
Thanks for your reply. The problem is exactly what you have specified. Google chrome is not allowing the local files to run.. To make it work, we have to run the chrome browser with the following flag.
"--allow-file-access-from-files".
Now its working well. Thanks for your time and effort.