diff options
author | Chien Yang <[email protected]> | 2007-03-07 00:09:16 +0000 |
---|---|---|
committer | Chien Yang <[email protected]> | 2007-03-07 00:09:16 +0000 |
commit | 462b4a4200cf6aeb6ac4f7133dd7f8ae1abae319 (patch) | |
tree | 78ef41b65107114a143dc100b1790c9e0b2d446b /src | |
parent | 3034edfa147c43cea5dc5384ff75715998016e29 (diff) |
1) Fix Issue 455 : Need to disable NPOT textures for older cards that claim to support it.
2) Clean up NPOT texture support.
git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@787 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src')
-rw-r--r-- | src/classes/jogl/javax/media/j3d/JoglPipeline.java | 17 | ||||
-rw-r--r-- | src/classes/share/javax/media/j3d/TextureRetained.java | 3 | ||||
-rw-r--r-- | src/native/d3d/D3dCtx.cpp | 2 | ||||
-rw-r--r-- | src/native/d3d/D3dDeviceInfo.cpp | 302 | ||||
-rw-r--r-- | src/native/d3d/D3dDeviceInfo.hpp | 149 | ||||
-rw-r--r-- | src/native/ogl/Canvas3D.c | 10 |
6 files changed, 241 insertions, 242 deletions
diff --git a/src/classes/jogl/javax/media/j3d/JoglPipeline.java b/src/classes/jogl/javax/media/j3d/JoglPipeline.java index ff22d5c..a6a134a 100644 --- a/src/classes/jogl/javax/media/j3d/JoglPipeline.java +++ b/src/classes/jogl/javax/media/j3d/JoglPipeline.java @@ -8436,11 +8436,18 @@ class JoglPipeline extends Pipeline { cv.textureExtendedFeatures |= Canvas3D.TEXTURE_LOD_RANGE; // look for OpenGL 2.0 features - if (gl20) { - if(!VirtualUniverse.mc.enforcePowerOfTwo) { - cv.textureExtendedFeatures |= Canvas3D.TEXTURE_NON_POWER_OF_TWO; - } - } + // Fix to Issue 455 : Need to disable NPOT textures for older cards that claim to support it. + // Some older cards (e.g., Nvidia fx500 and ATI 9800) claim to support OpenGL 2.0. + // This means that these cards have to support non-power-of-two (NPOT) texture, + // but their lack the necessary HW force the vendors the emulate this feature in software. + // The result is a ~100x slower down compare to power-of-two textures. + // Do not check for gl20 but instead check of GL_ARB_texture_non_power_of_two extension string + // if (gl20) { + // if(!VirtualUniverse.mc.enforcePowerOfTwo) { + // cv.textureExtendedFeatures |= Canvas3D.TEXTURE_NON_POWER_OF_TWO; + // } + // } + // Setup GL_EXT_abgr if (gl.isExtensionAvailable("GL_EXT_abgr")) { diff --git a/src/classes/share/javax/media/j3d/TextureRetained.java b/src/classes/share/javax/media/j3d/TextureRetained.java index 7fa241e..62afe95 100644 --- a/src/classes/share/javax/media/j3d/TextureRetained.java +++ b/src/classes/share/javax/media/j3d/TextureRetained.java @@ -1103,8 +1103,7 @@ abstract class TextureRetained extends NodeComponentRetained { private boolean isEnabled(Canvas3D cv) { if(widthOrHeightIsNPOT && - (((cv.textureExtendedFeatures & Canvas3D.TEXTURE_NON_POWER_OF_TWO ) == 0) || - VirtualUniverse.mc.enforcePowerOfTwo)) { + ((cv.textureExtendedFeatures & Canvas3D.TEXTURE_NON_POWER_OF_TWO ) == 0)) { return false; } return enable; diff --git a/src/native/d3d/D3dCtx.cpp b/src/native/d3d/D3dCtx.cpp index 6ce5d34..58b629b 100644 --- a/src/native/d3d/D3dCtx.cpp +++ b/src/native/d3d/D3dCtx.cpp @@ -1419,8 +1419,6 @@ VOID D3dCtx::setCanvasProperty(JNIEnv *env, jobject obj) jboolean enforcePowerOfTwo = getJavaBoolEnv(env, "enforcePowerOfTwo"); if(enforcePowerOfTwo) { // printf("DEBUG enforcePowerOfTwo is true"); - // Reset NPOT support as requested by user. - deviceInfo->supportNPOT = false; texMask &= ~javax_media_j3d_Canvas3D_TEXTURE_NON_POWER_OF_TWO; } env->SetIntField(obj, id, texMask); diff --git a/src/native/d3d/D3dDeviceInfo.cpp b/src/native/d3d/D3dDeviceInfo.cpp index b7d2f79..7ae16e7 100644 --- a/src/native/d3d/D3dDeviceInfo.cpp +++ b/src/native/d3d/D3dDeviceInfo.cpp @@ -22,141 +22,136 @@ D3dDeviceInfo::~D3dDeviceInfo() { } -VOID D3dDeviceInfo::setCaps(D3DCAPS9 *d3dCaps) -{ +VOID D3dDeviceInfo::setCaps(D3DCAPS9 *d3dCaps) { + + BOOL supportNPOT; + if (deviceType == D3DDEVTYPE_HAL ){ - isHardware = true; - isHardwareTnL = (d3dCaps->DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT); + isHardware = true; + isHardwareTnL = (d3dCaps->DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT); } else // D3DDEVTYPE_REF { - isHardware = false; - isHardwareTnL = false; + isHardware = false; + isHardwareTnL = false; } - - // D3DTEXTURECAPS_NONPOW2CONDITIONAL caps-bit indicates "conditional" - // Non Power of Two (NPOT) - // textures that only support CLAMP addressing and don't - // support mipmaps or compressed textures. - // But some new vcards supports NP2 unconditional (GF6 and above). - // Correct test for any kind of NP2 support: - // If both unconditional and conditional support is + + // D3DTEXTURECAPS_NONPOW2CONDITIONAL caps-bit indicates "conditional" + // Non Power of Two (NPOT) + // textures that only support CLAMP addressing and don't + // support mipmaps or compressed textures. + // But some new vcards supports NP2 unconditional (GF6 and above). + // Correct test for any kind of NP2 support: + // If both unconditional and conditional support is // unavailable then NP2 is not possible anyway. - // ------------------------------------------- - // POW2 | NP2_CONDITIONAL | result - // ------------------------------------------- - // true | true | CONDITIONAL NPOT(*) - // true | false | POW2 Only - // false| any | UNConditional NPOT (**) // - // --------------------------------------------- - // (**)OpenGL like, Java3D preferred. - // (*) below test: + // ------------------------------------------- + // POW2 | NP2_CONDITIONAL | result + // ------------------------------------------- + // true | true | CONDITIONAL NPOT(*) + // true | false | POW2 Only + // false| any | UNConditional NPOT (**) // + // --------------------------------------------- + // (**)OpenGL like, Java3D preferred. + // (*) below test: /* - * if (((d3dCaps->TextureCaps & D3DPTEXTURECAPS_POW2) != 0) && // POW2 is true + * if (((d3dCaps->TextureCaps & D3DPTEXTURECAPS_POW2) != 0) && // POW2 is true * ((d3dCaps->TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL) == 0)){ //NPOT_Cond is false * //Pow2 Only - * supportNPOT = false; + * supportNPOT = false; * } * else{ - * // both conditional and unconditional + * // both conditional and unconditional * supportNPOT = true; * } - */ - if(d3dCaps->TextureCaps & D3DPTEXTURECAPS_POW2){ + */ + if(d3dCaps->TextureCaps & D3DPTEXTURECAPS_POW2){ supportNPOT = false; if(d3dCaps->TextureCaps & D3DPTEXTURECAPS_NONPOW2CONDITIONAL){ - // NPOT conditionl But, in certain cases textures can ignore the power of 2 limitation - // As OpenGL is UNCONDITIONAL, it is not used by Java3D - //supportNPOT = true; + // NPOT conditionl But, in certain cases textures can ignore the power of 2 limitation + // As OpenGL is UNCONDITIONAL, it is not used by Java3D + //supportNPOT = true; } - }else{ - //UNconditional: Textures do not need to be a power of 2 in size - supportNPOT = true; - } - - - - - - // check if it supports at least vertex shader 1.1 - if(d3dCaps->VertexShaderVersion < D3DVS_VERSION(1,1)) - { - supportShaders11 = false; - } - else - { - supportShaders11 = true; - } - DWORD vsVersion = d3dCaps->VertexShaderVersion; - if (debug) - { - char* dt; - if (isHardware) - dt = "HAL"; - else - dt ="REL"; - - printf("Java3D: Supported Shaders = %d.%d in mode %s ", - HIBYTE(LOWORD(vsVersion)), - LOBYTE(LOWORD(vsVersion)), - dt); - - } - - //supportStreamOffset = - - supportDepthBias = (d3dCaps->RasterCaps & D3DPRASTERCAPS_DEPTHBIAS) != 0; - + }else{ + //UNconditional: Textures do not need to be a power of 2 in size + supportNPOT = true; + } + + // check if it supports at least vertex shader 1.1 + if(d3dCaps->VertexShaderVersion < D3DVS_VERSION(1, 1)) { + supportShaders11 = false; + } + else { + supportShaders11 = true; + } + DWORD vsVersion = d3dCaps->VertexShaderVersion; + if (debug) { + char* dt; + if (isHardware) + dt = "HAL"; + else + dt ="REL"; + + printf("Java3D: Supported Shaders = %d.%d in mode %s ", + HIBYTE(LOWORD(vsVersion)), + LOBYTE(LOWORD(vsVersion)), + dt); + + } + + //supportStreamOffset = + + supportDepthBias = (d3dCaps->RasterCaps & D3DPRASTERCAPS_DEPTHBIAS) != 0; + maxTextureBlendStages = d3dCaps->MaxTextureBlendStages; maxSimultaneousTextures = d3dCaps->MaxSimultaneousTextures; - + maxTextureUnitStageSupport = min(maxTextureBlendStages, maxSimultaneousTextures); supportMipmap = ((d3dCaps->TextureCaps & D3DPTEXTURECAPS_MIPMAP) != 0); - + texturePow2Only = ((d3dCaps->TextureCaps & D3DPTEXTURECAPS_POW2) != 0); - + textureSquareOnly = ((d3dCaps->TextureCaps & D3DPTEXTURECAPS_SQUAREONLY) != 0); - + linePatternSupport = false; //((d3dCaps->PrimitiveMiscCaps & D3DPMISCCAPS_LINEPATTERNREP) != 0); - + texBorderModeSupport = ((d3dCaps->TextureAddressCaps & D3DPTADDRESSCAPS_BORDER) != 0); - + texLerpSupport = ((d3dCaps->TextureOpCaps & D3DTEXOPCAPS_LERP) != 0); - + canRenderWindowed = true;//((d3dCaps->Caps2 & D3DCAPS2_CANRENDERWINDOWED) != 0); - + maxPrimitiveCount = d3dCaps->MaxPrimitiveCount; maxVertexIndex = min(vertexBufferMaxVertexLimit, d3dCaps->MaxVertexIndex); - + maxTextureHeight = d3dCaps->MaxTextureHeight; maxTextureWidth = d3dCaps->MaxTextureWidth; maxTextureDepth = d3dCaps->MaxVolumeExtent; - + maxActiveLights = d3dCaps->MaxActiveLights; maxPointSize = DWORD(d3dCaps->MaxPointSize); maxAnisotropy = d3dCaps->MaxAnisotropy; - + maxVertexCount[GEO_TYPE_QUAD_SET] = min(vertexBufferMaxVertexLimit, - maxPrimitiveCount << 1); - + maxPrimitiveCount << 1); + // Since index is used, we need to make sure than index range // is also support. maxVertexCount[GEO_TYPE_QUAD_SET] = min(maxVertexCount[GEO_TYPE_QUAD_SET], maxVertexIndex); - + maxVertexCount[GEO_TYPE_TRI_SET] = min(vertexBufferMaxVertexLimit, maxPrimitiveCount*3); - + maxVertexCount[GEO_TYPE_POINT_SET] = min(vertexBufferMaxVertexLimit, maxPrimitiveCount); - + maxVertexCount[GEO_TYPE_LINE_SET] = min(vertexBufferMaxVertexLimit, maxPrimitiveCount << 1); - + maxVertexCount[GEO_TYPE_TRI_STRIP_SET] = min(vertexBufferMaxVertexLimit, maxPrimitiveCount + 2); - + maxVertexCount[GEO_TYPE_TRI_FAN_SET] = min(vertexBufferMaxVertexLimit, maxPrimitiveCount + 2); - + maxVertexCount[GEO_TYPE_LINE_STRIP_SET] = min(vertexBufferMaxVertexLimit, - maxPrimitiveCount +1); + maxPrimitiveCount +1); maxVertexCount[GEO_TYPE_INDEXED_QUAD_SET] = maxVertexCount[GEO_TYPE_QUAD_SET]; maxVertexCount[GEO_TYPE_INDEXED_TRI_SET] = maxVertexCount[GEO_TYPE_TRI_SET]; maxVertexCount[GEO_TYPE_INDEXED_POINT_SET] = maxVertexCount[GEO_TYPE_POINT_SET]; @@ -164,92 +159,85 @@ VOID D3dDeviceInfo::setCaps(D3DCAPS9 *d3dCaps) maxVertexCount[GEO_TYPE_INDEXED_TRI_STRIP_SET] = maxVertexCount[GEO_TYPE_TRI_STRIP_SET]; maxVertexCount[GEO_TYPE_INDEXED_TRI_FAN_SET] = maxVertexCount[GEO_TYPE_TRI_FAN_SET]; maxVertexCount[GEO_TYPE_INDEXED_LINE_STRIP_SET] = maxVertexCount[GEO_TYPE_LINE_STRIP_SET]; - - if ( (d3dCaps->PresentationIntervals & D3DPRESENT_INTERVAL_IMMEDIATE) != 0) - supportRasterPresImmediate = true; - else - supportRasterPresImmediate = false; - + + if ( (d3dCaps->PresentationIntervals & D3DPRESENT_INTERVAL_IMMEDIATE) != 0) + supportRasterPresImmediate = true; + else + supportRasterPresImmediate = false; + if (((d3dCaps->RasterCaps & D3DPRASTERCAPS_FOGTABLE) != 0) && - ((d3dCaps->RasterCaps & D3DPRASTERCAPS_WFOG) != 0)) - { - // use pixel w-fog - fogMode = D3DRS_FOGTABLEMODE; - rangeFogEnable = false; + ((d3dCaps->RasterCaps & D3DPRASTERCAPS_WFOG) != 0)) { + // use pixel w-fog + fogMode = D3DRS_FOGTABLEMODE; + rangeFogEnable = false; } - else - if (((d3dCaps->RasterCaps & D3DPRASTERCAPS_FOGVERTEX) != 0) && - ((d3dCaps->RasterCaps & D3DPRASTERCAPS_FOGRANGE) != 0)) - - { - // use vertex range based fog - fogMode = D3DRS_FOGVERTEXMODE; - rangeFogEnable = true; - } - else - if ((d3dCaps->RasterCaps & D3DPRASTERCAPS_FOGTABLE) != 0) - { - // use pixel z-fog - fogMode = D3DRS_FOGTABLEMODE; - rangeFogEnable = false; + else + if (((d3dCaps->RasterCaps & D3DPRASTERCAPS_FOGVERTEX) != 0) && + ((d3dCaps->RasterCaps & D3DPRASTERCAPS_FOGRANGE) != 0)) + + { + // use vertex range based fog + fogMode = D3DRS_FOGVERTEXMODE; + rangeFogEnable = true; + } + else + if ((d3dCaps->RasterCaps & D3DPRASTERCAPS_FOGTABLE) != 0) { + // use pixel z-fog + fogMode = D3DRS_FOGTABLEMODE; + rangeFogEnable = false; + } + else + if (D3DPRASTERCAPS_FOGVERTEX) { + // use vertex z-fog + fogMode = D3DRS_FOGVERTEXMODE; + rangeFogEnable = false; + } + else { + if (debug) { + printf("[Java 3D] Fog not support in this device !\n"); } - else - if (D3DPRASTERCAPS_FOGVERTEX) - { - // use vertex z-fog - fogMode = D3DRS_FOGVERTEXMODE; - rangeFogEnable = false; - } - else - { - if (debug) - { - printf("[Java 3D] Fog not support in this device !\n"); - } - } - - + } + texMask = 0; - - if(supportNPOT){ - texMask |= javax_media_j3d_Canvas3D_TEXTURE_NON_POWER_OF_TWO; - } - + + if(supportNPOT){ + texMask |= javax_media_j3d_Canvas3D_TEXTURE_NON_POWER_OF_TWO; + } + if ((d3dCaps->TextureCaps & D3DPTEXTURECAPS_VOLUMEMAP) && - (maxTextureDepth > 0)) - { - texMask |= javax_media_j3d_Canvas3D_TEXTURE_3D; + (maxTextureDepth > 0)) { + texMask |= javax_media_j3d_Canvas3D_TEXTURE_3D; } - + if (d3dCaps->TextureCaps & D3DPTEXTURECAPS_CUBEMAP) { - texMask |= javax_media_j3d_Canvas3D_TEXTURE_CUBE_MAP; + texMask |= javax_media_j3d_Canvas3D_TEXTURE_CUBE_MAP; } - + if (maxTextureUnitStageSupport > 1) { - texMask |= javax_media_j3d_Canvas3D_TEXTURE_MULTI_TEXTURE; + texMask |= javax_media_j3d_Canvas3D_TEXTURE_MULTI_TEXTURE; } - + if (d3dCaps->TextureOpCaps & D3DTEXOPCAPS_DOTPRODUCT3) { - texMask |= javax_media_j3d_Canvas3D_TEXTURE_COMBINE_DOT3; + texMask |= javax_media_j3d_Canvas3D_TEXTURE_COMBINE_DOT3; } - + if (d3dCaps->TextureOpCaps & D3DTEXOPCAPS_SUBTRACT) { - texMask |= javax_media_j3d_Canvas3D_TEXTURE_COMBINE_SUBTRACT; + texMask |= javax_media_j3d_Canvas3D_TEXTURE_COMBINE_SUBTRACT; } - + if (d3dCaps->TextureOpCaps & D3DTEXOPCAPS_LERP) { - texMask |= (javax_media_j3d_Canvas3D_TEXTURE_LERP| - javax_media_j3d_Canvas3D_TEXTURE_COMBINE); + texMask |= (javax_media_j3d_Canvas3D_TEXTURE_LERP| + javax_media_j3d_Canvas3D_TEXTURE_COMBINE); } else if (d3dCaps->TextureOpCaps & - (D3DTEXOPCAPS_DOTPRODUCT3|D3DTEXOPCAPS_SUBTRACT| - D3DTEXOPCAPS_MODULATE|D3DTEXOPCAPS_ADD| - D3DTEXOPCAPS_ADDSIGNED)) { - texMask |= javax_media_j3d_Canvas3D_TEXTURE_COMBINE; + (D3DTEXOPCAPS_DOTPRODUCT3|D3DTEXOPCAPS_SUBTRACT| + D3DTEXOPCAPS_MODULATE|D3DTEXOPCAPS_ADD| + D3DTEXOPCAPS_ADDSIGNED)) { + texMask |= javax_media_j3d_Canvas3D_TEXTURE_COMBINE; } - - + + if (maxAnisotropy > 1) { - texMask |= javax_media_j3d_Canvas3D_TEXTURE_ANISOTROPIC_FILTER; + texMask |= javax_media_j3d_Canvas3D_TEXTURE_ANISOTROPIC_FILTER; } } diff --git a/src/native/d3d/D3dDeviceInfo.hpp b/src/native/d3d/D3dDeviceInfo.hpp index bc128b0..991d729 100644 --- a/src/native/d3d/D3dDeviceInfo.hpp +++ b/src/native/d3d/D3dDeviceInfo.hpp @@ -20,81 +20,80 @@ extern UINT vertexBufferMaxVertexLimit; #define D3DDEPTHFORMATSIZE 6 class D3dDeviceInfo { -public: - // Hardware Rasterizer - // Transform & Light Hardware Rasterizer - // Reference Rasterizer - char deviceName[40]; // One of above name - D3DDEVTYPE deviceType; // D3DDEVTYPE_HAL or D3DDEVTYPE_REF - BOOL desktopCompatible; // Can render in desktop mode - BOOL fullscreenCompatible; // Can render in fullscreen mode - // using current desktop mode setting - //issue 135 - adding device info - char* deviceVendor; - char* deviceRenderer; - char* deviceVersion; - - // each bitmask correspond to the support of - // D3DMULTISAMPLE_i_SAMPLES type, i = 2...16 - DWORD multiSampleSupport; - - // TRUE when d3dDepthFormat[i] support - BOOL depthFormatSupport[D3DDEPTHFORMATSIZE]; - - // depth format select - D3DFORMAT depthStencilFormat; - - // max z buffer depth support - UINT maxZBufferDepthSize; - - // max stencil buffer depth support - UINT maxStencilDepthSize; // new on 1.4 - - // Max vertex count support for each primitive - DWORD maxVertexCount[GEO_TYPE_INDEXED_LINE_STRIP_SET+1]; - - BOOL supportNPOT; // new on 1.5 NonPower of Two texture size - BOOL supportStencil; // new on 1.4 - BOOL supportShaders11; - BOOL isHardware; - BOOL isHardwareTnL; - BOOL supportDepthBias; - BOOL supportRasterPresImmediate; - BOOL canRenderWindowed; - BOOL supportMipmap; - BOOL texturePow2Only; - BOOL textureSquareOnly; - BOOL linePatternSupport; - BOOL texBorderModeSupport; - BOOL texLerpSupport; - DWORD maxTextureUnitStageSupport; - DWORD maxTextureBlendStages; - DWORD maxSimultaneousTextures; - DWORD maxTextureWidth; - DWORD maxTextureHeight; - DWORD maxTextureDepth; - DWORD maxPrimitiveCount; - DWORD maxVertexIndex; - DWORD maxActiveLights; - DWORD maxPointSize; - DWORD rangeFogEnable; - D3DRENDERSTATETYPE fogMode; - int texMask; - int maxAnisotropy; - - BOOL supportStreamOffset; - - D3dDeviceInfo(); - ~D3dDeviceInfo(); - - // set capabilities of this device - VOID setCaps(D3DCAPS9 *d3dCaps); - BOOL supportAntialiasing(); - D3DMULTISAMPLE_TYPE getBestMultiSampleType(); - int getTextureFeaturesMask(); - void findDepthStencilFormat(int minZDepth, int minZDepthStencil); - - + public: + // Hardware Rasterizer + // Transform & Light Hardware Rasterizer + // Reference Rasterizer + char deviceName[40]; // One of above name + D3DDEVTYPE deviceType; // D3DDEVTYPE_HAL or D3DDEVTYPE_REF + BOOL desktopCompatible; // Can render in desktop mode + BOOL fullscreenCompatible; // Can render in fullscreen mode + // using current desktop mode setting + //issue 135 - adding device info + char* deviceVendor; + char* deviceRenderer; + char* deviceVersion; + + // each bitmask correspond to the support of + // D3DMULTISAMPLE_i_SAMPLES type, i = 2...16 + DWORD multiSampleSupport; + + // TRUE when d3dDepthFormat[i] support + BOOL depthFormatSupport[D3DDEPTHFORMATSIZE]; + + // depth format select + D3DFORMAT depthStencilFormat; + + // max z buffer depth support + UINT maxZBufferDepthSize; + + // max stencil buffer depth support + UINT maxStencilDepthSize; // new on 1.4 + + // Max vertex count support for each primitive + DWORD maxVertexCount[GEO_TYPE_INDEXED_LINE_STRIP_SET+1]; + + BOOL supportStencil; // new on 1.4 + BOOL supportShaders11; + BOOL isHardware; + BOOL isHardwareTnL; + BOOL supportDepthBias; + BOOL supportRasterPresImmediate; + BOOL canRenderWindowed; + BOOL supportMipmap; + BOOL texturePow2Only; + BOOL textureSquareOnly; + BOOL linePatternSupport; + BOOL texBorderModeSupport; + BOOL texLerpSupport; + DWORD maxTextureUnitStageSupport; + DWORD maxTextureBlendStages; + DWORD maxSimultaneousTextures; + DWORD maxTextureWidth; + DWORD maxTextureHeight; + DWORD maxTextureDepth; + DWORD maxPrimitiveCount; + DWORD maxVertexIndex; + DWORD maxActiveLights; + DWORD maxPointSize; + DWORD rangeFogEnable; + D3DRENDERSTATETYPE fogMode; + int texMask; + int maxAnisotropy; + + BOOL supportStreamOffset; + + D3dDeviceInfo(); + ~D3dDeviceInfo(); + + // set capabilities of this device + VOID setCaps(D3DCAPS9 *d3dCaps); + BOOL supportAntialiasing(); + D3DMULTISAMPLE_TYPE getBestMultiSampleType(); + int getTextureFeaturesMask(); + void findDepthStencilFormat(int minZDepth, int minZDepthStencil); + + }; #endif diff --git a/src/native/ogl/Canvas3D.c b/src/native/ogl/Canvas3D.c index 00b281e..2a7cfc1 100644 --- a/src/native/ogl/Canvas3D.c +++ b/src/native/ogl/Canvas3D.c @@ -649,12 +649,20 @@ getPropertiesFromCurrentContext( /* look for OpenGL 2.0 features */ - if (ctxInfo->gl20) { + /* + // Fix to Issue 455 : Need to disable NPOT textures for older cards that claim to support it. + // Some older cards (e.g., Nvidia fx500 and ATI 9800) claim to support OpenGL 2.0. + // This means that these cards have to support non-power-of-two (NPOT) texture, + // but their lack the necessary HW force the vendors the emulate this feature in software. + // The result is a ~100x slower down compare to power-of-two textures. + // Do not check for gl20 but instead check of GL_ARB_texture_non_power_of_two extension string + if (ctxInfo->gl20) { if (!getJavaBoolEnv(env, "enforcePowerOfTwo")) { ctxInfo->textureExtMask |= javax_media_j3d_Canvas3D_TEXTURE_NON_POWER_OF_TWO; } } + */ /* check extensions for remaining of 1.1 and 1.2 */ if(isExtensionSupported(tmpExtensionStr, "GL_EXT_multi_draw_arrays")){ |