mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
103.05k stars 35.41k forks source link

the shader doesn't run normal #2725

Closed im007boy closed 10 years ago

im007boy commented 12 years ago

When I refresh the page, why the result is different? Sometimes right, sometimes wrong.

http://im007boy.github.com/threejs-test/webgl_shader_test.html

im007boy commented 12 years ago

the right result is https://raw.github.com/im007boy/threejs-test/cc832779d8953a581e8f0c6153a01ee65bb824c0/shader.jpg

mrdoob commented 12 years ago

And how's the wrong result?

im007boy commented 12 years ago

blue points are not visible

my browser is chrome 24.0.1312.27,system:windows7

gero3 commented 12 years ago

Which browser and os??

mrdoob commented 12 years ago

And graphics card?

im007boy commented 12 years ago

Intel(R) HD Graphics (Core i3) maybe chrome bug? firefox 17.0.1 is right.

KariTrace commented 12 years ago

Win7 x32 Intel(R) HD Graphics (Core i3) Chrome Version 23.0.1271.95 m: ok FF 17.0: ok

im007boy commented 12 years ago

my system is x64, http://mrdoob.github.com/three.js/examples/webgl_sprites.html is always right,but http://mrdoob.github.com/three.js/examples/webgl_particles_shapes.html has the same problem(only text is visible)

my another test http://www.youtube.com/watch?v=rS8B691Suqo&feature=youtu.be ,using THREE.ParticleBasicMaterial

gero3 commented 12 years ago

I got it once too, I'm thinking it is a texture problem

alteredq commented 12 years ago

@im007boy So I gather you are on Chrome dev channel or maybe beta?

You mentioned Chrome 24, stable is 23, Canary is 25.

I also started noticed random texture related issues in Canary while stable Chrome is fine. It's a bad sign if they trickled into dev channel or beta :S

It would be good to file a Chrome bug with some minimal test case.

im007boy commented 12 years ago

@alteredq chrome 24.0.1312.27 (170126) beta-m, I will test more case.

alteredq commented 12 years ago

Duh, this is bad. It means in not so long time when Chrome 24 hits stable most of three.js demos will break :S

toji commented 12 years ago

Thanks @alteredq for bringing this to my attention. This is definitely a bug in Chrome, though I think it's probably more accurately a change in ANGLE that caused it. It appears that the breaking change in ANGLE was made somewhere between revision 1275 and 1289, though which commit in that range it is I'm not sure.

I'll keep you updated.

toji commented 11 years ago

FYI: https://code.google.com/p/chromium/issues/detail?id=164680

alteredq commented 11 years ago

@toji Thanks ;).

I'm pretty positive though that there is also something wrong going on with textures independently of point sprites. I noticed these problems first in my ongoing deferred rendering experimentations (where I don't use point sprites at all).

Similar like for particles example, also there in Chrome Canary 25.0.1351.0 on multiple reloads some textures just stay black. In this case though the problem happens both in ANGLE and in OpenGL so cause will be different.

Another texture fail in Chrome Canary both in ANGLE and OpenGL (this one happens every time):

http://mrdoob.github.com/three.js/examples/webgl_animation_skinning.html

These ones also get black textures randomly upon reloads (Canary ANGLE and OpenGL):

http://alteredqualia.com/three/examples/webgl_animation_skinning_doom3.html http://alteredqualia.com/three/examples/webgl_animation_skinning_tf2.html

BTW meanwhile I also found video texture crashing current Chrome Canary on ANGLE with "aw snap" (OpenGL here works fine):

http://mrdoob.github.com/three.js/examples/webgl_materials_video.html

toji commented 11 years ago

Those seem to be unrelated to the issue described in the OP, though I can see how they may appear to be related at first glance.

Did those problems just start, and if so do you know around what Chrome version? Do you see similar behavior in any other browsers?

alteredq commented 11 years ago

@toji Yup, now they indeed do look like two new issues (black texture + video texture crash).

I think I started to notice random black textures something like 2 weeks ago. Video texture crash I just found out yesterday, when checking for other examples with broken textures.

Sorry, I don't remember exact Chrome version, it was up to date Canary at each moment, so Chrome 25 something from about two weeks ago?

Though I don't use Canary that often, so it could have been going on unnoticed for a bit longer.

Only other browser where WebGL runs reliably for me is Firefox and these examples are ok there. Also of course stable Chrome is ok.

toji commented 11 years ago

RE: Black texture issue, I've got a Chrome Bug entered for it and a pretty good idea of at least what point the break occurred. Follow that ticket for updates.

alteredq commented 11 years ago

So it seems this may be because of new GL state caching feature being implemented. This would be pretty awesome thing to have and well worth few hiccups on the way ;).

We already try to do some GL state caching on three.js level but as WebGLInspector shows, we still fail rather often :S.