After modifying the script a bit, I can see that MOZ_WEBGL_depth_texture is
there.
But the depth texture creation still fails.
I found the console feature in firefox (I'm new to web dev) and saw this
output:
*11:30:34.395 [object WebGLExtensionDepthTexture] swaag.js:5923*
*11:30:35.146 "ignoring setsockopt command" swaag.js:7672*
*11:30:35.103 Error: WebGL: texImage2D: with format of DEPTH_COMPONENT or
DEPTH_STENCIL target must be TEXTURE_2D, data must be nullptr, level must
be zero*
Modified script:
* char req[] =*
* "var ctx =
Module.canvas.getContext('experimental-webgl');\n"*
* "var wk_dt =
ctx.getExtension('WEBKIT_WEBGL_depth_texture');\n"*
* "var mz_dt =
ctx.getExtension('MOZ_WEBGL_depth_texture');\n"*
* "console.log( wk_dt );\n"*
* "console.log( mz_dt );\n";*
* emscripten_run_script(req);*
I don't understand why it claims that data must be null pointer?
I use this code on many different devices, yet WEBGL does not like it.
Bram
On Thursday, January 16, 2014 10:05:59 AM UTC-8, Bram Stolk wrote:
>
> Thanks Zephon,
>
>
> I tried your suggestion (although emscripten_run_script seems to be a void
> func, and cannot return an int.)
>
> When added, and running in firefox, the application seems to hang, and
> never draws anything in the canvas.
> I added it after setting the SDL video mode.
>
> On Thursday, January 16, 2014 8:38:41 AM UTC-8, zephon wrote:
>>
>> have you tried something like this?
>>
>> #ifdef EMSCRIPTEN
>> char req[] = "var ctx =
>> Module.canvas.getContext('experimental-webgl');\n"
>> "if(ctx.getExtension('WEBKIT_WEBGL_depth_texture') != NULL) return 1;\n"
>> "else if (ctx.getExtension('MOZ_WEBGL_depth_texture') != NULL) return
>> 1;\n"
>> "else return 0;\n";
>>
>> int res = emscripten_run_script(req);
>> #endif
>>
>> WebGL extensions must be activated with getExtension() before being
>> used...
>>
>> On Wednesday, January 15, 2014 7:13:39 AM UTC+1, Bram Stolk wrote:
>>>
>>> My emscripted OpenGL-ES2 game fails to create a depth texture.
>>> The extension is supported on my machine, yet:
>>>
>>> I try to create the depth texture with:
>>> glTexImage2D( GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, SHADOWBUFFERSIZE,
>>> SHADOWBUFFERSIZE, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, depthbuffermem );
>>>
>>> This results in:
>>> GL_INVALID_OPERATION
>>>
>>> I guess it could be a limit of WebGL not supporting depth textures?
>>> Or could it be something emscripten does not tolerate?
>>>
>>> I use firefox to load the HTML created with ASM_JS=1.
>>> Also, my frag+vert GLSL shaders get compiled and linked just fine.
>>>
>>> My OpenGL context is created via SDL:
>>> SDL_Surface* screen = SDL_SetVideoMode( 640, 480, 16, SDL_OPENGL );
>>>
>>> Thx,
>>>
>>> bram
>>>
>>>
--
You received this message because you are subscribed to the Google Groups
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.