Hey,
I've been playing around with emscripten and tried instancing but ran into 
a problem in windows browsers:
I'm rendering 1 blue square with glDrawArrays() and 6 yellow squares with 
glDrawArraysInstanced(). Unfortunately the result
isn't quite what I expect it to be. At least in Windows browsers:

Expected:
<https://lh3.googleusercontent.com/-QS9y7wRn-1g/VhEaqyVtijI/AAAAAAAAAGw/hGVh2mGYX3w/s1600/Expected.png>

Result in Windows browsers (Firefox, Chrome, Opera):

<https://lh3.googleusercontent.com/-V7kosdauX1I/VhEayeK2V2I/AAAAAAAAAG4/AKt20p8pi84/s1600/Result.png>


I get the expected result if I start the program as an "exe" on Windows or 
on Linux (executable on the OS and in browsers).
I tested it with the 1.34.1 emsdk and the portable version on linux.

Note: It doesn't matter on which OS I create the .html. It just won't show 
me the expected result in the mentioned windows browsers.

The test code can be found 
here: https://github.com/compix/Emscripten-Instancing-Test
I tried to keep it as minimal and readable as possible with a few error 
checks.

The cause of the problem seems to be the glVertexAttribDivisor(0, 1) in 
InstancingTest.cpp line 156. I didn't have any problems without it.

I am using 2 attributes for the instancing case: "in_sPos" as the instanced 
attribute with divisor 1 and "in_pos" as a non-instanced attribute.
If I change the order of the attributes in the test code I get the expected 
result. But this doesn't really fix the problem because
1. The order shouldn't matter.
2. It will cause problems if more geometry and different vertex layouts 
come in.

Maybe there is a problem in my code but I checked it multiple times and I 
don't think it's a coincidence that it just doesn't display the expected 
result in windows browsers.

I'd much appreciate if someone could take a look at it.

Regards
Wladimir


-- 
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/d/optout.

Reply via email to