• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Main repository of MikuMikuStudio


Commit MetaInfo

Révisionda676279e8881cb1d630f4663c23c75397b0d4b5 (tree)
l'heure2013-04-20 02:00:25
AuteurShAdOwIsLoRd <ShAdOwIsLoRd@75d0...>
CommiterShAdOwIsLoRd

Message de Log

  • LwjglRenderer adds capability for texture array support if OpenGL 3 is available
  • Renderer will check texture array support prior to uploading texture

git-svn-id: http://jmonkeyengine.googlecode.com/svn/trunk@10563 75d07b2b-3a1a-0410-a2c5-0572b91ccdca

Change Summary

Modification

--- a/engine/src/lwjgl/com/jme3/renderer/lwjgl/LwjglRenderer.java
+++ b/engine/src/lwjgl/com/jme3/renderer/lwjgl/LwjglRenderer.java
@@ -319,7 +319,7 @@ public class LwjglRenderer implements Renderer {
319319 }
320320 }
321321
322- if (ctxCaps.GL_EXT_texture_array) {
322+ if (ctxCaps.GL_EXT_texture_array || ctxCaps.OpenGL30) {
323323 caps.add(Caps.TextureArray);
324324 }
325325
@@ -1753,6 +1753,7 @@ public class LwjglRenderer implements Renderer {
17531753 if (context.pointSprite) {
17541754 return; // Attempt to fix glTexParameter crash for some ATI GPUs
17551755 }
1756+
17561757 // repeat modes
17571758 switch (tex.getType()) {
17581759 case ThreeDimensional:
@@ -1886,9 +1887,15 @@ public class LwjglRenderer implements Renderer {
18861887 TextureUtil.uploadTexture(img, GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, i, 0);
18871888 }
18881889 } else if (target == EXTTextureArray.GL_TEXTURE_2D_ARRAY_EXT) {
1890+ if (!caps.contains(Caps.TextureArray)) {
1891+ throw new RendererException("Texture arrays not supported by graphics hardware");
1892+ }
1893+
18891894 List<ByteBuffer> data = img.getData();
1895+
18901896 // -1 index specifies prepare data for 2D Array
18911897 TextureUtil.uploadTexture(img, target, -1, 0);
1898+
18921899 for (int i = 0; i < data.size(); i++) {
18931900 // upload each slice of 2D array in turn
18941901 // this time with the appropriate index