Exemplo n.º 1
0
    //-----------------------------------------------------------------------
    TextureUnitState::TextureUnitState( Pass* parent, const String& texName, unsigned int texCoordSet)
		: mCurrentFrame(0)
		, mAnimDuration(0)
		, mCubic(false)
		, mTextureType(TEX_TYPE_2D)
        , mDesiredFormat(PF_UNKNOWN)
		, mTextureSrcMipmaps(MIP_DEFAULT)
		, mTextureCoordSetIndex(0)
		, mBorderColour(ColourValue::Black)
		, mTextureLoadFailed(false)
		, mIsAlpha(false)
		, mHwGamma(false)
		, mRecalcTexMatrix(false)
		, mUMod(0)
		, mVMod(0)
		, mUScale(1)
		, mVScale(1)
		, mRotate(0)
		, mTexModMatrix(Matrix4::IDENTITY)
		, mMinFilter(FO_LINEAR)
		, mMagFilter(FO_LINEAR)
		, mMipFilter(FO_POINT)
		, mMaxAniso(MaterialManager::getSingleton().getDefaultAnisotropy())
		, mMipmapBias(0)
		, mIsDefaultAniso(true)
		, mIsDefaultFiltering(true)
		, mBindingType(BT_FRAGMENT)
		, mContentType(CONTENT_NAMED)
		, mParent(parent)
		, mAnimController(0)
    {
		mColourBlendMode.blendType = LBT_COLOUR;
		mAlphaBlendMode.operation = LBX_MODULATE;
		mAlphaBlendMode.blendType = LBT_ALPHA;
		mAlphaBlendMode.source1 = LBS_TEXTURE;
		mAlphaBlendMode.source2 = LBS_CURRENT;
		setColourOperation(LBO_MODULATE);
		setTextureAddressingMode(TAM_WRAP);

        setTextureName(texName);
        setTextureCoordSet(texCoordSet);

		if( Pass::getHashFunction() == Pass::getBuiltinHashFunction( Pass::MIN_TEXTURE_CHANGE ) )
		{
			mParent->_dirtyHash();
		}

    }
Exemplo n.º 2
0
    //-----------------------------------------------------------------------
    TextureUnitState::TextureUnitState( Pass* parent, const String& texName, unsigned int texCoordSet)
		: mCurrentFrame(0)
		, mAnimDuration(0)
		, mCubic(false)
		, mTextureType(TEX_TYPE_2D)
        , mDesiredFormat(PF_UNKNOWN)
		, mTextureSrcMipmaps(MIP_DEFAULT)
		, mTextureCoordSetIndex(0)
		, mBorderColour(ColourValue::Black)
		, mTextureLoadFailed(false)
		, mIsAlpha(false)
		, mHwGamma(false)
		, mRecalcTexMatrix(false)
		, mUMod(0)
		, mVMod(0)
		, mUScale(1)
		, mVScale(1)
		, mRotate(0)
		, mTexModMatrix(Matrix4::IDENTITY)
		, mMinFilter(FO_LINEAR)
		, mMagFilter(FO_LINEAR)
		, mMipFilter(FO_POINT)
		, mMaxAniso(MaterialManager::getSingleton().getDefaultAnisotropy())
		, mIsDefaultAniso(true)
		, mIsDefaultFiltering(true)
		, mBindingType(BT_FRAGMENT)
		, mContentType(CONTENT_NAMED)
		, mParent(parent)
		, mAnimController(0)
    {

        setTextureName(texName);
        setTextureCoordSet(texCoordSet);

        mParent->_dirtyHash();

    }
Exemplo n.º 3
0
    //-----------------------------------------------------------------------
    TextureUnitState::TextureUnitState( Pass* parent, const String& texName, unsigned int texCoordSet)
        : mCurrentFrame(0)
        , mAnimDuration(0)
        , mCubic(false)
        , mTextureCoordSetIndex(0)
        , mTextureLoadFailed(false)
        , mGamma(1)
        , mRecalcTexMatrix(false)
        , mUMod(0)
        , mVMod(0)
        , mUScale(1)
        , mVScale(1)
        , mRotate(0)
        , mTexModMatrix(Matrix4::IDENTITY)
        , mBindingType(BT_FRAGMENT)
        , mContentType(CONTENT_NAMED)
        , mSampler(TextureManager::getSingletonPtr() ? TextureManager::getSingleton().getDefaultSampler() : DUMMY_SAMPLER)
        , mParent(parent)
        , mAnimController(0)
    {
        mColourBlendMode.blendType = LBT_COLOUR;
        mAlphaBlendMode.operation = LBX_MODULATE;
        mAlphaBlendMode.blendType = LBT_ALPHA;
        mAlphaBlendMode.source1 = LBS_TEXTURE;
        mAlphaBlendMode.source2 = LBS_CURRENT;
        setColourOperation(LBO_MODULATE);

        setTextureName(texName);
        setTextureCoordSet(texCoordSet);

        if( Pass::getHashFunction() == Pass::getBuiltinHashFunction( Pass::MIN_TEXTURE_CHANGE ) )
        {
            mParent->_dirtyHash();
        }

    }