mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
WIP of timmy's changes merged in. Not properly initializing the probes/array slots just yet.
This commit is contained in:
parent
ba8948a5b1
commit
26471aaa77
10 changed files with 485 additions and 159 deletions
|
|
@ -49,6 +49,7 @@ protected:
|
|||
|
||||
|
||||
U32 mMipMapLevels;
|
||||
|
||||
bool mInitialized;
|
||||
public:
|
||||
|
||||
|
|
@ -62,6 +63,7 @@ public:
|
|||
virtual void initDynamic( U32 texSize, GFXFormat faceFormat = GFXFormatR8G8B8A8, U32 mipLevels = 0 ) = 0;
|
||||
|
||||
void initNormalize(U32 size);
|
||||
|
||||
GFXCubemap();
|
||||
virtual ~GFXCubemap();
|
||||
|
||||
|
|
@ -71,6 +73,9 @@ public:
|
|||
/// Returns the face texture format.
|
||||
virtual GFXFormat getFormat() const = 0;
|
||||
|
||||
/// Returns if this cubemap has been initialized
|
||||
virtual bool isInitialized() { return false; }
|
||||
|
||||
/// Returns the cubemap file path set at creation.
|
||||
const String& getPath() const { return mPath; }
|
||||
|
||||
|
|
@ -83,7 +88,6 @@ public:
|
|||
|
||||
/// Get Z up face index of the cubemap. DDS files will be stored Y up
|
||||
static U32 zUpFaceIndex(const U32 index);
|
||||
bool isInitialised() { return mInitialized; }
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -102,32 +106,43 @@ public:
|
|||
void free() { StrongObjectRef::set( NULL ); }
|
||||
};
|
||||
|
||||
/// Cubemap array
|
||||
/// Cubemap array - data lives on the GPU only with this class, but the data is not immutable so it can be updated
|
||||
class GFXCubemapArray : public StrongRefBase, public GFXResource
|
||||
{
|
||||
friend class GFXDevice;
|
||||
friend class GFXTextureManager;
|
||||
|
||||
protected:
|
||||
// should only be called by GFXDevice
|
||||
/// should only be called by GFXDevice
|
||||
virtual void setToTexUnit( U32 tuNum ) = 0;
|
||||
/// number of cubemaps in the array
|
||||
U32 mNumCubemaps;
|
||||
/// cubemap face size
|
||||
U32 mSize;
|
||||
/// number of mip levels
|
||||
U32 mMipMapLevels;
|
||||
/// format
|
||||
GFXFormat mFormat;
|
||||
|
||||
public:
|
||||
|
||||
virtual ~GFXCubemapArray() {};
|
||||
|
||||
virtual void initStatic(GFXCubemapHandle *cubemaps, const U32 cubemapCount) = 0;
|
||||
/// Initialize from an array of cubemaps
|
||||
virtual void init(GFXCubemapHandle *cubemaps, const U32 cubemapCount) = 0;
|
||||
/// Initialize cubemapCount number of blank cubemaps in the array
|
||||
virtual void init(const U32 cubemapCount, const U32 cubemapFaceSize, const GFXFormat format) = 0;
|
||||
/// Update cubemap in the array
|
||||
virtual void updateTexture(const GFXCubemapHandle &cubemap, const U32 slot) = 0;
|
||||
/// Copy this cubemap to another - destination must be same format, same face size & at-least the same size(or larger)
|
||||
virtual void copyTo(GFXCubemapArray *pDstCubemap) = 0;
|
||||
/// Return number of textures in the array
|
||||
const U32 getNumCubemaps() const { return mNumCubemaps; }
|
||||
/// Get the number of mip maps
|
||||
const U32 getMipMapLevels() const { return mMipMapLevels; }
|
||||
/// Returns the size of the faces.
|
||||
const U32 getSize() const { return mSize; }
|
||||
/// Returns the format
|
||||
const GFXFormat getFormat() const { return mFormat; }
|
||||
|
||||
virtual const String describeSelf() const;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue