WebGLSamples / WebGL2Samples

Short and easy to understand samples demonstrating WebGL 2 features
Other
1.01k stars 143 forks source link

texture cube #42

Closed shrekshao closed 8 years ago

shrekshao commented 8 years ago
shrekshao commented 8 years ago

Since I use gl-Matrix min, which fail the travis test, is there a way to ignore this file? @pjcozzi

pjcozzi commented 8 years ago

Since I use gl-Matrix min, which fail the travis test, is there a way to ignore this file

If it's easy, fix the warnings and open a pull request for that project.

Otherwise, ignore it by modifying this line of the build script: https://github.com/WebGLSamples/WebGL2Samples/blob/master/gulpfile.js#L7

pjcozzi commented 8 years ago

samples/gl-matrix-min.js

Move this to a sub-directory, e.g., samples/third-party/gl-matrix-min.js

pjcozzi commented 8 years ago

What is specific to WebGL 2 about this sample?

I don't think TEXTURE_CUBE_MAP_SEAMLESS is in ES 3.0 so it will not be in WebGL 2.

See Sections 3.8.9 and F.2 of the ES 3.0 spec (in general, please check the ES spec when in doubt).

OpenGL ES 3.0 requires that all cube map filtering be seamless. OpenGL ES 2.0 specified that a single cube map face be selected and used for filtering

shrekshao commented 8 years ago

Yeah, I agree with TEXTURE_CUBE_MAP_SEAMLESS is not available in WebGL 2. In light of this, merely using TEXTURE_CUBE_MAP is meaningless for WebGL 2. Shall I close this pull request later?

Anyway, with this try we now have :

Not bad

shrekshao commented 8 years ago

For Seamless cube map, https://docs.google.com/presentation/d/1Orx0GB0cQcYhHkYsaEcoo5js3c5-pv7ahPniIRIzzfg/edit#slide=id.gd15060520_0_38 It is mentioned in WebGL 2 spec, yet I can't find it in either ES 3 or WebGL 2 conformance test

pjcozzi commented 8 years ago

@shrekshao the enum is not in the spec because it is always enabled. As I said above:

See Sections 3.8.9 and F.2 of the ES 3.0 spec (in general, please check the ES spec when in doubt).

OpenGL ES 3.0 requires that all cube map filtering be seamless. OpenGL ES 2.0 specified that a single cube map face be selected and used for filtering

shrekshao commented 8 years ago

Oh oh, I misunderstand it. Besides this, I fail to find anything specific to WebGL 2

pjcozzi commented 8 years ago

OK, let's delete the sample and keep any potential useful code in this branch until we need it - then we can git cherry-pick the commits.

kenrussell commented 8 years ago

FYI: es3fShaderTextureFunctionTests.js , es3fTextureFilteringTests.js and es3fTextureShadowTests.js should be testing whether cube maps are seamless in WebGL 2.0.

shrekshao commented 8 years ago

Hi @kenrussell , I took a look at these js files. However I noticed that the "seamless flag" are all related to the testing framework, but I failed to find any GL calls that setting the TEXTURE_CUBE_MAP_SEAMLESS. So I am a bit confused here. I don't understand why there's no such a call.

kenrussell commented 8 years ago

The reason there's no such parameter is that cube maps are always seamless in OpenGL ES 3.0 and there's no way to disable that behavior.

shrekshao commented 8 years ago

Ok.. Thank you for the clarification!