#0 

09-08-2015 20:38:09

Magun
SleekThink Producer
Lieu: Punakha
Date d'inscription: 18-11-2007
Messages: 902
Corrections: 2
Site web

Salut personne smile
bon voila l'autre jours j'ai poster un topic sur le chargement des scenes en thread spar
mais bon on n'a pas vraiement regarder de prt a ce que j'avais fait comme code d'example !

du coup j'ai fait un petit patch pour faire a

Code:

Index: include/IVideoDriver.h
===================================================================
--- include/IVideoDriver.h    (revision 5114)
+++ include/IVideoDriver.h    (working copy)
@@ -19,6 +19,7 @@
 #include "EDriverTypes.h"
 #include "EDriverFeatures.h"
 #include "SExposedVideoData.h"
+#include "IImage.h"
 
 namespace irr
 {
@@ -467,7 +468,7 @@
         The value is a safe approximation, i.e. can be larger than the
         actual value of pixels. */
         virtual u32 getOcclusionQueryResult(scene::ISceneNode* node) const =0;
-        
+
         //! Create render target.
         virtual IRenderTarget* addRenderTarget() = 0;
 
@@ -1449,6 +1450,19 @@
         */
         virtual void convertColor(const void* sP, ECOLOR_FORMAT sF, s32 sN,
                 void* dP, ECOLOR_FORMAT dF) const =0;
+
+    /**
+    Change who texture is loaded, if "DefferedTextureLoader" is used
+    @getTexture(...) return a FakeTexture type and then cached
+    when DefferedTextureLoader is returned to false, the cache is cleanup
+    and all texture is reloaded at the same address by a driver dependent texture
+    */
+    virtual void setDeferredTextureLoader(bool) = 0;
+
+    /**
+    return the current state of "DefferedTextureLoader"
+    */
+    virtual bool useDeferredTextureLoader() const = 0;
     };
 
 } // end namespace video
Index: source/Irrlicht/CNullDriver.cpp
===================================================================
--- source/Irrlicht/CNullDriver.cpp    (revision 5114)
+++ source/Irrlicht/CNullDriver.cpp    (working copy)
@@ -23,6 +23,60 @@
 namespace video
 {
 
+    FakeTexture::FakeTexture(irr::video::IVideoDriver *driver, IImage* surface,
+        const io::path& name, void* mipmapData) :
+        ITexture(name), Image(surface), MipData(mipmapData), Driver(driver)
+    {
+        Image->grab();
+    }
+    FakeTexture::~FakeTexture()
+    {
+        // Image droped when this object is transformed to a driver dependent texture
+    }
+    void* FakeTexture::lock(E_TEXTURE_LOCK_MODE mode, u32 mipmapLevel) _IRR_OVERRIDE_
+    {
+        return Image->lock();
+    }
+    void FakeTexture::unlock() _IRR_OVERRIDE_
+    {
+        return Image->unlock();
+    }
+    void FakeTexture::regenerateMipMapLevels(void* mipmapData)
+    {
+    }
+    const core::dimension2d<u32>& FakeTexture::getOriginalSize() const
+    {
+      return Image->getDimension();
+    }
+    const core::dimension2d<u32>& FakeTexture::getSize() const
+    {
+      return Image->getDimension();
+    }
+    E_DRIVER_TYPE FakeTexture::getDriverType() const
+    {
+      return Driver->getDriverType();
+    };
+    ECOLOR_FORMAT FakeTexture::getColorFormat() const
+    {
+      return Image->getColorFormat();
+    }
+    u32 FakeTexture::getPitch() const
+    {
+      return Image->getPitch();
+    }
+    bool FakeTexture::hasMipMaps() const
+    {
+      return MipData;
+    }
+    bool FakeTexture::hasAlpha() const
+    {
+      return true; /* ??? */
+    }
+    bool FakeTexture::isRenderTarget() const
+    {
+      return false;
+    }
+
 //! creates a loader which is able to load windows bitmaps
 IImageLoader* createImageLoaderBMP();
 
@@ -85,7 +139,7 @@
 CNullDriver::CNullDriver(io::IFileSystem* io, const core::dimension2d<u32>& screenSize)
     : SharedRenderTarget(0), CurrentRenderTarget(0), CurrentRenderTargetSize(0, 0), FileSystem(io), MeshManipulator(0),
     ViewPort(0, 0, 0, 0), ScreenSize(screenSize), PrimitivesDrawn(0), MinVertexCountForVBO(500),
-    TextureCreationFlags(0), OverrideMaterial2DEnabled(false), AllowZWriteOnTransparent(false)
+    TextureCreationFlags(0), OverrideMaterial2DEnabled(false), AllowZWriteOnTransparent(false), DeferredLoader(false)
 {
     #ifdef _DEBUG
     setDebugName("CNullDriver");
@@ -626,6 +680,25 @@
 }
 
 
+/**
+Change who texture is loaded, if "DefferedTextureLoader" is used
+@getTexture(...) return a FakeTexture type and then cached
+when DefferedTextureLoader is returned to false, the cache is cleanup
+and all texture is reloaded at the same address by a driver dependent texture
+*/
+void CNullDriver::setDeferredTextureLoader(bool i)
+{
+    DeferredLoader = i;
+}
+
+/**
+return the current state of "DefferedTextureLoader"
+*/
+bool CNullDriver::useDeferredTextureLoader() const
+{
+    return DeferredLoader;
+}
+
 //! set a render target
 bool CNullDriver::setRenderTarget(IRenderTarget* target, const core::array<u32>& activeTextureID, bool clearBackBuffer,
     bool clearDepthBuffer, bool clearStencilBuffer, SColor clearColor)
Index: source/Irrlicht/CNullDriver.h
===================================================================
--- source/Irrlicht/CNullDriver.h    (revision 5114)
+++ source/Irrlicht/CNullDriver.h    (working copy)
@@ -38,6 +38,44 @@
     class IImageLoader;
     class IImageWriter;
 
+
+  class IVideoDriver;
+
+  class FakeTexture : public ITexture
+  {
+  public:
+    FakeTexture(irr::video::IVideoDriver *driver, IImage* surface,
+        const io::path& name, void* mipmapData);
+
+    virtual ~FakeTexture();
+
+    virtual void* lock(E_TEXTURE_LOCK_MODE mode=ETLM_READ_WRITE, u32 mipmapLevel=0) _IRR_OVERRIDE_;
+
+    virtual void unlock() _IRR_OVERRIDE_;
+
+    virtual void regenerateMipMapLevels(void* mipmapData = 0);
+
+    virtual const core::dimension2d<u32>& getOriginalSize() const;
+
+    virtual const core::dimension2d<u32>& getSize() const;
+
+    virtual E_DRIVER_TYPE getDriverType() const;
+
+    virtual ECOLOR_FORMAT getColorFormat() const;
+
+    virtual u32 getPitch() const;
+
+    virtual bool hasMipMaps() const;
+
+    virtual bool hasAlpha() const;
+
+    virtual bool isRenderTarget() const;
+  public:
+    IImage* Image;
+    void* MipData;
+    IVideoDriver* Driver;
+  };
+
     class CNullDriver : public IVideoDriver, public IGPUProgrammingServices
     {
     public:
@@ -678,6 +716,19 @@
                 const c8* name=0);
 
         virtual bool checkDriverReset() _IRR_OVERRIDE_ {return false;}
+
+    /**
+    Change who texture is loaded, if "DefferedTextureLoader" is used
+    @getTexture(...) return a FakeTexture type and then cached
+    when DefferedTextureLoader is returned to false, the cache is cleanup
+    and all texture is reloaded at the same address by a driver dependent texture
+    */
+    virtual void setDeferredTextureLoader(bool);
+
+    /**
+    return the current state of "DefferedTextureLoader"
+    */
+    virtual bool useDeferredTextureLoader() const;
     protected:
 
         //! deletes all textures
@@ -880,6 +931,9 @@
         bool AllowZWriteOnTransparent;
 
         bool FeatureEnabled[video::EVDF_COUNT];
+    bool DeferredLoader;
+
+    core::list<FakeTexture*> CachedDefferedLoader;
     };
 
 } // end namespace video
Index: source/Irrlicht/COpenGLDriver.cpp
===================================================================
--- source/Irrlicht/COpenGLDriver.cpp    (revision 5114)
+++ source/Irrlicht/COpenGLDriver.cpp    (working copy)
@@ -2492,7 +2492,7 @@
     else if (texture->getDriverType() != EDT_OPENGL)
     {
         CurrentTexture.set(stage, 0);
-        os::Printer::log("Fatal Error: Tried to set a texture not owned by this driver.", ELL_ERROR);
+        //os::Printer::log("Fatal Error: Tried to set a texture not owned by this driver.", ELL_ERROR);
         return false;
     }
 
@@ -2549,10 +2549,49 @@
 //! returns a device dependent texture from a software surface (IImage)
 video::ITexture* COpenGLDriver::createDeviceDependentTexture(IImage* surface, const io::path& name, void* mipmapData)
 {
-    return new COpenGLTexture(surface, name, mipmapData, this);
+    if(DeferredLoader)
+    {
+        //! sizeof(FakeTexture) < sizeof(COpenGLTexture)
+        video::FakeTexture *tmp = (FakeTexture*) ::operator new (sizeof(COpenGLTexture));
+        new ((void*)tmp) FakeTexture(this, surface, name, mipmapData);
+        CachedDefferedLoader.push_back(tmp);
+        return tmp;
+    }
+    return new COpenGLTexture(surface, name, mipmapData, this);
 }
 
+/**
+Change who texture is loaded, if "DefferedTextureLoader" is used
+@getTexture(...) return a FakeTexture type and then cached
+when DefferedTextureLoader is returned to false, the cache is cleanup
+and all texture is reloaded at the same address by a driver dependent texture
+*/
+void COpenGLDriver::setDeferredTextureLoader(bool i)
+{
+    CNullDriver::setDeferredTextureLoader(i);
+    if(!i)
+    {
+        os::Printer::log("load deferred texture", ELL_WARNING);
 
+        for(core::list<FakeTexture*>::Iterator it = CachedDefferedLoader.begin();
+            it != CachedDefferedLoader.end(); ++it)
+        {
+            video::FakeTexture *tmp = *it;
+
+            IImage* Image = tmp->Image;
+            void* MipData = tmp->MipData;
+            const io::SNamedPath& name = tmp->getName();
+
+            tmp->~FakeTexture();
+
+            new ((void*)tmp) COpenGLTexture(Image, name, MipData, this);
+            Image->drop();
+        }
+        CachedDefferedLoader.clear();
+    }
+}
+
+
 //! Sets a material. All 3d drawing functions draw geometry now using this material.
 void COpenGLDriver::setMaterial(const SMaterial& material)
 {
Index: source/Irrlicht/COpenGLDriver.h
===================================================================
--- source/Irrlicht/COpenGLDriver.h    (revision 5114)
+++ source/Irrlicht/COpenGLDriver.h    (working copy)
@@ -425,6 +425,13 @@
         //! Get bridge calls.
         COpenGLCallBridge* getBridgeCalls() const;
 
+    /**
+    Change who texture is loaded, if "DefferedTextureLoader" is used
+    @getTexture(...) return a FakeTexture type and then cached
+    when DefferedTextureLoader is returned to false, the cache is cleanup
+    and all texture is reloaded at the same address by a driver dependent texture
+    */
+    virtual void setDeferredTextureLoader(bool);
     private:
 
         bool updateVertexHardwareBuffer(SHWBufferLink_opengl *HWBuffer);

et est donc utiliser de cette faon

Code c++ :



bool loading = true;

loadScreen.setVisible(true);
driver->setDeferredTextureLoader(true);

task = std::async(std::launch::async, [&]{
    smgr->loadScene("......");
    loading = false;
});
// then in your loading class or main while do
if(!loading)
{
    loadScreen.setVisible(false);
    driver->setDeferredTextureLoader(false);
    switchToGameState();
}



http://irrlicht.sourceforge.net/forum/v … 20#p294720

Hors ligne


#1 

30-09-2015 08:28:19

johnplayer
Habitu
Date d'inscription: 30-09-2007
Messages: 431

Qu'est-ce que tu veux dire par chargement diffr? Quelle est la diffrence par rapport au chargement normal?


core i7 4970K @ 4GHz - 32GB ddr3 19200(2400MHz) - ssd samsung 840 evo 250GB - GTX1080Ti (4K) - Cooler master storm stryker blanc.
"L'alcool, c'est comme Activia, c'est actif à l'intérieur et ça se voit à l'extérieur."

Hors ligne


#2 

01-10-2015 12:11:42

Magun
SleekThink Producer
Lieu: Punakha
Date d'inscription: 18-11-2007
Messages: 902
Corrections: 2
Site web

la diffrence c'est que, quand tu charge une scene en multi-threading
les textures sont cre en mme temps or le context graphique est lier au processus principal ce qui fait echouer la cration de la texture et sont upload dans le gpu du coup t'a pas de texture afficher mme si elle sont charger
de cette faon la, une "fausse" texture est cre (un genre de warper avec la mme taille en mmoire que la vrai) et l'or de la fin du chargement (tu apelle setDeferredTextureLoader(false)) elle sont alors transformer la mme adresse  en "vrais" texture dans le thread principal et donc uploader correctement sur le gpu
a permet de faire des crans de chargement animer en gros, ou charger 2 scene en mme temps smile
a reste performant puisque irrlicht charge une IImage avans de cre la texture, donc c'est vraiment que l'upload vers le gpu qui est ralis

Hors ligne


#3 

11-10-2015 08:57:01

johnplayer
Habitu
Date d'inscription: 30-09-2007
Messages: 431

Ah ok. C'est super utile, parce que c'est vrai que les crans de chargement fixes sont embtants. On se demande toujours si le jeu est plant, si il fait quelque chose... Il faudra que je teste a ds que je passerai l'implmentation des crans de chargement. Merci de continuer participer sur ce forum malgr le dclin d'intrt wink. J'espre que l'on verra ce forum remonter la pente parce qu'Irrlicht est vraiment un moteur simple pour faire des petites appli ou jeu sympa.


core i7 4970K @ 4GHz - 32GB ddr3 19200(2400MHz) - ssd samsung 840 evo 250GB - GTX1080Ti (4K) - Cooler master storm stryker blanc.
"L'alcool, c'est comme Activia, c'est actif à l'intérieur et ça se voit à l'extérieur."

Hors ligne


#4 

12-10-2015 22:36:49

Magun
SleekThink Producer
Lieu: Punakha
Date d'inscription: 18-11-2007
Messages: 902
Corrections: 2
Site web

ouaip !

j'ai un code qui traine pour faire des barres de chargement en cercle a donne pas mal sur mon diteur
http://sleek-think.ovh/websvn/filedetails.php?repname=irrlicht&amp;path=%2Fround-progress%2Frender.png
irrlicht n'aime pas trop les rotations de texture a fait un rendu pourris  smile (ou alors j'ai oublier l'antialiasing ...)
j'ai une autre version qui fonctionne comme un "pie chart" et j'ai changer la mthode de rotation

je passerais faire un poste d'ici "qeulques" semaine

Hors ligne


#5 

26-11-2015 19:18:23

Magun
SleekThink Producer
Lieu: Punakha
Date d'inscription: 18-11-2007
Messages: 902
Corrections: 2
Site web

petite mise jours avec les changements de la revision 5189.

Code c++ :


Index: Irrlicht/include/IVideoDriver.h
===================================================================
--- Irrlicht/include/IVideoDriver.h    (revision 5189)
+++ Irrlicht/include/IVideoDriver.h    (working copy)
@@ -1494,6 +1494,18 @@
        */
        virtual void convertColor(const void* sP, ECOLOR_FORMAT sF, s32 sN,
                void* dP, ECOLOR_FORMAT dF) const =0;
+    /**
+    Change who texture is loaded, if "DefferedTextureLoader" is used
+    @getTexture(...) return a FakeTexture type and then cached
+    when DefferedTextureLoader is returned to false, the cache is cleanup
+    and all texture is reloaded at the same address by a driver dependent texture
+    */

+    virtual void setDeferredTextureLoader(bool) = 0;
+
+    /**
+    return the current state of "DefferedTextureLoader"
+    */

+    virtual bool useDeferredTextureLoader() const = 0;
    };

} // end namespace video
Index: Irrlicht/source/Irrlicht/CNullDriver.cpp
===================================================================
--- Irrlicht/source/Irrlicht/CNullDriver.cpp    (revision 5189)
+++ Irrlicht/source/Irrlicht/CNullDriver.cpp    (working copy)
@@ -81,11 +81,65 @@
//! creates a writer which is able to save ppm images
IImageWriter* createImageWriterPPM();

+    FakeTexture::FakeTexture(irr::video::IVideoDriver *driver, IImage* surface,
+        const io::path& name) :
+        ITexture(name), Image(surface), MipData(0), Driver(driver)
+    {
+        Image->grab();
+    }
+    FakeTexture::~FakeTexture()
+    {
+        // Image droped when this object is transformed to a driver dependent texture
+    }
+    void* FakeTexture::lock(E_TEXTURE_LOCK_MODE mode, u32 mipmapLevel) _IRR_OVERRIDE_
+    {
+        return Image->getData();
+    }
+    void FakeTexture::unlock() _IRR_OVERRIDE_
+    {
+    }
+    void FakeTexture::regenerateMipMapLevels(void* data, u32 layer)
+    {
+        Image->setMipMapsData(data, true, false);
+    }
+    const core::dimension2d<u32>& FakeTexture::getOriginalSize() const
+    {
+      return Image->getDimension();
+    }
+    const core::dimension2d<u32>& FakeTexture::getSize() const
+    {
+      return Image->getDimension();
+    }
+    E_DRIVER_TYPE FakeTexture::getDriverType() const
+    {
+      return Driver->getDriverType();
+    };
+    ECOLOR_FORMAT FakeTexture::getColorFormat() const
+    {
+      return Image->getColorFormat();
+    }
+    u32 FakeTexture::getPitch() const
+    {
+      return Image->getPitch();
+    }
+    bool FakeTexture::hasMipMaps() const
+    {
+      return MipData;
+    }
+    bool FakeTexture::hasAlpha() const
+    {
+      return true; /* ??? */
+    }
+    bool FakeTexture::isRenderTarget() const
+    {
+      return false;
+    }
+
//! constructor
CNullDriver::CNullDriver(io::IFileSystem* io, const core::dimension2d<u32>& screenSize)
    : SharedRenderTarget(0), CurrentRenderTarget(0), CurrentRenderTargetSize(0, 0), FileSystem(io), MeshManipulator(0),
    ViewPort(0, 0, 0, 0), ScreenSize(screenSize), PrimitivesDrawn(0), MinVertexCountForVBO(500),
-    TextureCreationFlags(0), OverrideMaterial2DEnabled(false), AllowZWriteOnTransparent(false)
+    TextureCreationFlags(0), OverrideMaterial2DEnabled(false), AllowZWriteOnTransparent(false), DeferredLoader(false)
{
    #ifdef _DEBUG
    setDebugName("CNullDriver");
@@ -231,7 +285,25 @@
    removeAllHardwareBuffers();
}

+/**
+Change who texture is loaded, if "DefferedTextureLoader" is used
+@getTexture(...) return a FakeTexture type and then cached
+when DefferedTextureLoader is returned to false, the cache is cleanup
+and all texture is reloaded at the same address by a driver dependent texture
+*/

+void CNullDriver::setDeferredTextureLoader(bool i)
+{
+    DeferredLoader = i;
+}

+/**
+return the current state of "DefferedTextureLoader"
+*/

+bool CNullDriver::useDeferredTextureLoader() const
+{
+    return DeferredLoader;
+}
+
//! Adds an external surface loader to the engine.
void CNullDriver::addExternalImageLoader(IImageLoader* loader)
{
Index: Irrlicht/source/Irrlicht/CNullDriver.h
===================================================================
--- Irrlicht/source/Irrlicht/CNullDriver.h    (revision 5189)
+++ Irrlicht/source/Irrlicht/CNullDriver.h    (working copy)
@@ -38,6 +38,42 @@
    class IImageLoader;
    class IImageWriter;

+  class IVideoDriver;
+
+  class FakeTexture : public ITexture
+  {
+  public:
+    FakeTexture(irr::video::IVideoDriver *driver, IImage* surface, const io::path& name);
+
+    virtual ~FakeTexture();
+
+    virtual void* lock(E_TEXTURE_LOCK_MODE mode=ETLM_READ_WRITE, u32 mipmapLevel=0) _IRR_OVERRIDE_;
+
+    virtual void unlock() _IRR_OVERRIDE_;
+
+    virtual void regenerateMipMapLevels(void* data = 0, u32 layer = 0);
+
+    virtual const core::dimension2d<u32>& getOriginalSize() const;
+
+    virtual const core::dimension2d<u32>& getSize() const;
+
+    virtual E_DRIVER_TYPE getDriverType() const;
+
+    virtual ECOLOR_FORMAT getColorFormat() const;
+
+    virtual u32 getPitch() const;
+
+    virtual bool hasMipMaps() const;
+
+    virtual bool hasAlpha() const;
+
+    virtual bool isRenderTarget() const;
+  public:
+    IImage* Image;
+    void* MipData;
+    IVideoDriver* Driver;
+  };
+
    class CNullDriver : public IVideoDriver, public IGPUProgrammingServices
    {
    public:
@@ -669,6 +705,19 @@
                const c8* name=0);

        virtual bool checkDriverReset() _IRR_OVERRIDE_ {return false;}
+
+    /**
+    Change who texture is loaded, if "DefferedTextureLoader" is used
+    @getTexture(...) return a FakeTexture type and then cached
+    when DefferedTextureLoader is returned to false, the cache is cleanup
+    and all texture is reloaded at the same address by a driver dependent texture
+    */

+    virtual void setDeferredTextureLoader(bool);
+
+    /**
+    return the current state of "DefferedTextureLoader"
+    */

+    virtual bool useDeferredTextureLoader() const;
    protected:

        //! deletes all textures
@@ -872,6 +921,9 @@
        bool RangeFog;
        bool AllowZWriteOnTransparent;

+    bool DeferredLoader;
+    core::list<FakeTexture*> CachedDefferedLoader;
+
        bool FeatureEnabled[video::EVDF_COUNT];
    };

Index: Irrlicht/source/Irrlicht/COpenGLDriver.cpp
===================================================================
--- Irrlicht/source/Irrlicht/COpenGLDriver.cpp    (revision 5189)
+++ Irrlicht/source/Irrlicht/COpenGLDriver.cpp    (working copy)
@@ -2554,20 +2554,64 @@
//! returns a device dependent texture from a software surface (IImage)
video::ITexture* COpenGLDriver::createDeviceDependentTexture(IImage* surface, const io::path& name)
{
-    COpenGLTexture* texture = 0;
+    if(DeferredLoader)
+    {
+        //! sizeof(FakeTexture) < sizeof(COpenGLTexture)
+        video::FakeTexture *tmp = (FakeTexture*) ::operator new (sizeof(COpenGLTexture));
+        new ((void*)tmp) FakeTexture(this, surface, name);
+        CachedDefferedLoader.push_back(tmp);
+        return tmp;
+    }
+    else
+    {
+        COpenGLTexture* texture = 0;

-    if (surface && checkColorFormat(surface->getColorFormat(), surface->getDimension()))
-    {
-        core::array<IImage*> imageArray(1);
-        imageArray.push_back(surface);
+        if (surface && checkColorFormat(surface->getColorFormat(), surface->getDimension()))
+        {
+          core::array<IImage*> imageArray(1);
+          imageArray.push_back(surface);

-        texture = new COpenGLTexture(name, imageArray, this);
-    }
+          texture = new COpenGLTexture(name, imageArray, this);
+        }

-    return texture;
+        return texture;
+    }
}

+/**
+Change who texture is loaded, if "DefferedTextureLoader" is used
+@getTexture(...) return a FakeTexture type and then cached
+when DefferedTextureLoader is returned to false, the cache is cleanup
+and all texture is reloaded at the same address by a driver dependent texture
+*/

+void COpenGLDriver::setDeferredTextureLoader(bool i)
+{
+    CNullDriver::setDeferredTextureLoader(i);
+    if(!i)
+    {
+        os::Printer::log("load deferred texture", ELL_WARNING);

+        for(core::list<FakeTexture*>::Iterator it = CachedDefferedLoader.begin();
+            it != CachedDefferedLoader.end(); ++it)
+        {
+            video::FakeTexture *tmp = *it;
+
+            IImage* Image = tmp->Image;
+            void* MipData = tmp->MipData;
+            const io::SNamedPath& name = tmp->getName();
+
+            tmp->~FakeTexture();
+
+            core::array<IImage*> imageArray(1);
+            imageArray.push_back(Image);
+
+            new ((void*)tmp) COpenGLTexture(name, imageArray, this);
+            Image->drop();
+        }
+        CachedDefferedLoader.clear();
+    }
+}
+
//! Sets a material. All 3d drawing functions draw geometry now using this material.
void COpenGLDriver::setMaterial(const SMaterial& material)
{
@@ -4800,7 +4844,7 @@
    case ECF_G32R32F:
        if (queryOpenGLFeature(COpenGLExtensionHandler::IRR_ARB_texture_rg))
        {
-            internalFormat = GL_RG32F;           
+            internalFormat = GL_RG32F;
            pixelFormat = GL_RG;
            pixelType = GL_FLOAT;
        }
@@ -4810,7 +4854,7 @@
    case ECF_A32B32G32R32F:
        if (queryOpenGLFeature(COpenGLExtensionHandler::IRR_ARB_texture_float))
        {
-            internalFormat = GL_RGBA32F_ARB;           
+            internalFormat = GL_RGBA32F_ARB;
            pixelFormat = GL_RGBA;
            pixelType = GL_FLOAT;
        }
Index: Irrlicht/source/Irrlicht/COpenGLDriver.h
===================================================================
--- Irrlicht/source/Irrlicht/COpenGLDriver.h    (revision 5189)
+++ Irrlicht/source/Irrlicht/COpenGLDriver.h    (working copy)
@@ -411,6 +411,13 @@

        COpenGLCacheHandler* getCacheHandler() const;

+    /**
+    Change who texture is loaded, if "DefferedTextureLoader" is used
+    @getTexture(...) return a FakeTexture type and then cached
+    when DefferedTextureLoader is returned to false, the cache is cleanup
+    and all texture is reloaded at the same address by a driver dependent texture
+    */

+    virtual void setDeferredTextureLoader(bool);
    private:

        bool updateVertexHardwareBuffer(SHWBufferLink_opengl *HWBuffer);



ps: https://sourceforge.net/p/irrlicht/patches/303/

Hors ligne


Options Liens officiels Caractristiques Statistiques Communaut
Corrections
irrlicht
irrklang
irredit
irrxml
xhtml 1.0
css 2.1
Propuls par FluxBB
Traduit par FluxBB.fr
Analys par
872 membres
1423 sujets
11109 messages
Dernier membre inscrit: Glider
9 invits en ligne
Aucun membre connect
RSS Feed

[ Gnre en 0.017 sec., 11 requtes excutes ]