Disable NPOT support for webgl driver. This also allows to enable mip-mapping again.

WebGL allows NPOT textures in very specific situations (no mips, no filters, no texture-repeats), but disabling it by default fixes a lot of problems.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@5447 dfc29bdd-3216-0410-991c-e03cc46cb475
master
cutealien 2017-04-21 13:00:07 +00:00
parent 9fb422b496
commit dbb2590c55
2 changed files with 7 additions and 3 deletions

View File

@ -24,7 +24,13 @@ CWebGL1Driver::CWebGL1Driver(const SIrrlichtCreationParameters& params, io::IFil
setDebugName("CWebGL1Driver");
#endif
setTextureCreationFlag(ETCF_CREATE_MIP_MAPS, false); // so far causing errors, have to figure out later
// NPOT are not allowed for WebGL in most cases.
// One can use them when:
// - The TEXTURE_MIN_FILTER is linear or nearest
// - no mipmapping is used
// - no texture wrapping is used (so all texture_wraps have to be CLAMP_TO_EDGE)
// So users could still enable them for specific cases (usually GUI), but in general better to have it off.
disableFeature(EVDF_TEXTURE_NPOT);
MBLinesSize2 = createSimpleMeshBuffer(2, scene::EPT_LINES);
MBTriangleFanSize4 = createSimpleMeshBuffer(4, scene::EPT_TRIANGLE_FAN);

View File

@ -113,8 +113,6 @@ namespace video
video::SColor leftDownEdge = video::SColor(0,0,0,0),
video::SColor rightDownEdge = video::SColor(0,0,0,0)) _IRR_OVERRIDE_;
protected:
// create a meshbuffer which has as many vertices as indices
scene::SMeshBuffer* createSimpleMeshBuffer(irr::u32 numVertices, scene::E_PRIMITIVE_TYPE primitiveType, scene::E_HARDWARE_MAPPING vertexMappingHint=scene::EHM_STREAM, scene::E_HARDWARE_MAPPING indexMappingHint=scene::EHM_STATIC) const;