mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-19 20:24:49 +00:00
Merge remote-tracking branch 'upstream/development' into torquescript-errorPrinting
This commit is contained in:
commit
f82082f59f
|
|
@ -171,7 +171,7 @@ namespace IBLUtilities
|
|||
prefilterConsts->setSafe(prefilterRoughnessSC, roughness);
|
||||
prefilterConsts->setSafe(prefilterMipSizeSC, mipSize);
|
||||
U32 size = prefilterSize * mPow(0.5f, mip);
|
||||
renderTarget->attachTexture(GFXTextureTarget::Color0, cubemapOut, face, mip);
|
||||
renderTarget->attachTexture(GFXTextureTarget::Color0, cubemapOut, face);
|
||||
GFX->setActiveRenderTarget(renderTarget, false);//we set the viewport ourselves
|
||||
GFX->setViewport(RectI(0, 0, size, size));
|
||||
GFX->clear(GFXClearTarget, LinearColorF::BLACK, 1.0f, 0);
|
||||
|
|
|
|||
|
|
@ -33,8 +33,7 @@ GFXD3D11Cubemap::GFXD3D11Cubemap() : mTexture(NULL), mSRView(NULL), mDSView(NULL
|
|||
mFaceFormat = GFXFormatR8G8B8A8;
|
||||
for (U32 i = 0; i < CubeFaces; i++)
|
||||
{
|
||||
for(U32 j=0; j < MaxMipMaps; j++)
|
||||
mRTView[i][j] = NULL;
|
||||
mRTView[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -50,8 +49,7 @@ void GFXD3D11Cubemap::releaseSurfaces()
|
|||
|
||||
for (U32 i = 0; i < CubeFaces; i++)
|
||||
{
|
||||
for (U32 j = 0; j < MaxMipMaps; j++)
|
||||
SAFE_RELEASE(mRTView[i][j]);
|
||||
SAFE_RELEASE(mRTView[i]);
|
||||
}
|
||||
|
||||
SAFE_RELEASE(mDSView);
|
||||
|
|
@ -212,16 +210,16 @@ void GFXD3D11Cubemap::initStatic(DDSFile *dds)
|
|||
|
||||
void GFXD3D11Cubemap::initDynamic(U32 texSize, GFXFormat faceFormat, U32 mipLevels)
|
||||
{
|
||||
if(!mDynamic)
|
||||
GFXTextureManager::addEventDelegate(this, &GFXD3D11Cubemap::_onTextureEvent);
|
||||
if (!mDynamic)
|
||||
GFXTextureManager::addEventDelegate(this, &GFXD3D11Cubemap::_onTextureEvent);
|
||||
|
||||
mDynamic = true;
|
||||
mTexSize = texSize;
|
||||
mFaceFormat = faceFormat;
|
||||
if (!mipLevels)
|
||||
mAutoGenMips = true;
|
||||
mDynamic = true;
|
||||
mTexSize = texSize;
|
||||
mFaceFormat = faceFormat;
|
||||
if (!mipLevels)
|
||||
mAutoGenMips = true;
|
||||
|
||||
mMipMapLevels = mipLevels;
|
||||
mMipMapLevels = mipLevels;
|
||||
|
||||
bool compressed = ImageUtil::isCompressedFormat(mFaceFormat);
|
||||
|
||||
|
|
@ -233,36 +231,30 @@ void GFXD3D11Cubemap::initDynamic(U32 texSize, GFXFormat faceFormat, U32 mipLeve
|
|||
miscFlags |= D3D11_RESOURCE_MISC_GENERATE_MIPS;
|
||||
}
|
||||
|
||||
D3D11_TEXTURE2D_DESC desc;
|
||||
D3D11_TEXTURE2D_DESC desc;
|
||||
|
||||
desc.Width = mTexSize;
|
||||
desc.Height = mTexSize;
|
||||
desc.MipLevels = mMipMapLevels;
|
||||
desc.ArraySize = 6;
|
||||
desc.Format = GFXD3D11TextureFormat[mFaceFormat];
|
||||
desc.SampleDesc.Count = 1;
|
||||
desc.SampleDesc.Quality = 0;
|
||||
desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
desc.Width = mTexSize;
|
||||
desc.Height = mTexSize;
|
||||
desc.MipLevels = mMipMapLevels;
|
||||
desc.ArraySize = 6;
|
||||
desc.Format = GFXD3D11TextureFormat[mFaceFormat];
|
||||
desc.SampleDesc.Count = 1;
|
||||
desc.SampleDesc.Quality = 0;
|
||||
desc.Usage = D3D11_USAGE_DEFAULT;
|
||||
desc.BindFlags = bindFlags;
|
||||
desc.CPUAccessFlags = 0;
|
||||
desc.CPUAccessFlags = 0;
|
||||
desc.MiscFlags = miscFlags;
|
||||
|
||||
|
||||
HRESULT hr = D3D11DEVICE->CreateTexture2D(&desc, NULL, &mTexture);
|
||||
HRESULT hr = D3D11DEVICE->CreateTexture2D(&desc, NULL, &mTexture);
|
||||
|
||||
D3D11_SHADER_RESOURCE_VIEW_DESC SMViewDesc;
|
||||
SMViewDesc.Format = GFXD3D11TextureFormat[mFaceFormat];
|
||||
SMViewDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURECUBE;
|
||||
SMViewDesc.TextureCube.MipLevels = mAutoGenMips ? -1 : mMipMapLevels;
|
||||
SMViewDesc.TextureCube.MostDetailedMip = 0;
|
||||
D3D11_SHADER_RESOURCE_VIEW_DESC SMViewDesc;
|
||||
SMViewDesc.Format = GFXD3D11TextureFormat[mFaceFormat];
|
||||
SMViewDesc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURECUBE;
|
||||
SMViewDesc.TextureCube.MipLevels = -1;
|
||||
SMViewDesc.TextureCube.MostDetailedMip = 0;
|
||||
|
||||
hr = D3D11DEVICE->CreateShaderResourceView(mTexture, &SMViewDesc, &mSRView);
|
||||
|
||||
|
||||
if(FAILED(hr))
|
||||
{
|
||||
AssertFatal(false, "GFXD3D11Cubemap::initDynamic - CreateTexture2D call failure");
|
||||
}
|
||||
hr = D3D11DEVICE->CreateShaderResourceView(mTexture, &SMViewDesc, &mSRView);
|
||||
|
||||
//Generate mips
|
||||
if (mAutoGenMips && !compressed)
|
||||
|
|
@ -274,62 +266,37 @@ void GFXD3D11Cubemap::initDynamic(U32 texSize, GFXFormat faceFormat, U32 mipLeve
|
|||
mMipMapLevels = viewDesc.TextureCube.MipLevels;
|
||||
}
|
||||
|
||||
D3D11_RENDER_TARGET_VIEW_DESC viewDesc;
|
||||
viewDesc.Format = desc.Format;
|
||||
viewDesc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2DARRAY;
|
||||
viewDesc.Texture2DArray.ArraySize = 1;
|
||||
|
||||
for (U32 i = 0; i < CubeFaces; i++)
|
||||
if (FAILED(hr))
|
||||
{
|
||||
viewDesc.Texture2DArray.FirstArraySlice = i;
|
||||
for (U32 j = 0; j < mMipMapLevels; j++)
|
||||
{
|
||||
viewDesc.Texture2DArray.MipSlice = j;
|
||||
hr = D3D11DEVICE->CreateRenderTargetView(mTexture, &viewDesc, &mRTView[i][j]);
|
||||
|
||||
if (FAILED(hr))
|
||||
{
|
||||
AssertFatal(false, "GFXD3D11Cubemap::initDynamic - CreateRenderTargetView call failure");
|
||||
}
|
||||
}
|
||||
AssertFatal(false, "GFXD3D11Cubemap::initDynamic - CreateTexture2D call failure");
|
||||
}
|
||||
|
||||
D3D11_TEXTURE2D_DESC depthTexDesc;
|
||||
depthTexDesc.Width = mTexSize;
|
||||
depthTexDesc.Height = mTexSize;
|
||||
depthTexDesc.MipLevels = 1;
|
||||
depthTexDesc.ArraySize = 1;
|
||||
depthTexDesc.SampleDesc.Count = 1;
|
||||
depthTexDesc.SampleDesc.Quality = 0;
|
||||
depthTexDesc.Format = DXGI_FORMAT_D32_FLOAT;
|
||||
depthTexDesc.Usage = D3D11_USAGE_DEFAULT;
|
||||
depthTexDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL;
|
||||
depthTexDesc.CPUAccessFlags = 0;
|
||||
depthTexDesc.MiscFlags = 0;
|
||||
D3D11_RENDER_TARGET_VIEW_DESC viewDesc;
|
||||
viewDesc.Format = desc.Format;
|
||||
viewDesc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2DARRAY;
|
||||
viewDesc.Texture2DArray.ArraySize = 1;
|
||||
viewDesc.Texture2DArray.MipSlice = 0;
|
||||
for (U32 i = 0; i < CubeFaces; i++)
|
||||
{
|
||||
viewDesc.Texture2DArray.FirstArraySlice = i;
|
||||
hr = D3D11DEVICE->CreateRenderTargetView(mTexture, &viewDesc, &mRTView[i]);
|
||||
|
||||
ID3D11Texture2D* depthTex = 0;
|
||||
hr = D3D11DEVICE->CreateTexture2D(&depthTexDesc, 0, &depthTex);
|
||||
|
||||
if(FAILED(hr))
|
||||
{
|
||||
AssertFatal(false, "GFXD3D11Cubemap::initDynamic - CreateTexture2D for depth stencil call failure");
|
||||
}
|
||||
|
||||
// Create the depth stencil view for the entire cube
|
||||
D3D11_DEPTH_STENCIL_VIEW_DESC dsvDesc;
|
||||
dsvDesc.Format = depthTexDesc.Format; //The format must match the depth texture we created above
|
||||
dsvDesc.Flags = 0;
|
||||
dsvDesc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D;
|
||||
dsvDesc.Texture2D.MipSlice = 0;
|
||||
hr = D3D11DEVICE->CreateDepthStencilView(depthTex, &dsvDesc, &mDSView);
|
||||
|
||||
if(FAILED(hr))
|
||||
{
|
||||
AssertFatal(false, "GFXD3D11Cubemap::initDynamic - CreateDepthStencilView call failure");
|
||||
}
|
||||
|
||||
SAFE_RELEASE(depthTex);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
AssertFatal(false, "GFXD3D11Cubemap::initDynamic - CreateRenderTargetView call failure");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void GFXD3D11Cubemap::generateMipMaps()
|
||||
{
|
||||
//Generate mips
|
||||
D3D11DEVICECONTEXT->GenerateMips(mSRView);
|
||||
//get mip level count
|
||||
D3D11_SHADER_RESOURCE_VIEW_DESC viewDesc;
|
||||
mSRView->GetDesc(&viewDesc);
|
||||
mMipMapLevels = viewDesc.TextureCube.MipLevels;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -359,11 +326,11 @@ ID3D11ShaderResourceView* GFXD3D11Cubemap::getSRView()
|
|||
return mSRView;
|
||||
}
|
||||
|
||||
ID3D11RenderTargetView* GFXD3D11Cubemap::getRTView(U32 faceIdx, U32 mipIndex)
|
||||
ID3D11RenderTargetView* GFXD3D11Cubemap::getRTView(U32 faceIdx)
|
||||
{
|
||||
AssertFatal(faceIdx < CubeFaces, "GFXD3D11Cubemap::getRTView - face index out of bounds");
|
||||
|
||||
return mRTView[faceIdx][mipIndex];
|
||||
return mRTView[faceIdx];
|
||||
}
|
||||
|
||||
ID3D11DepthStencilView* GFXD3D11Cubemap::getDSView()
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ public:
|
|||
void initStatic( GFXTexHandle *faces ) override;
|
||||
void initStatic( DDSFile *dds ) override;
|
||||
void initDynamic( U32 texSize, GFXFormat faceFormat = GFXFormatR8G8B8A8, U32 mipLevels = 0) override;
|
||||
void generateMipMaps() override;
|
||||
void setToTexUnit( U32 tuNum ) override;
|
||||
U32 getSize() const override { return mTexSize; }
|
||||
GFXFormat getFormat() const override { return mFaceFormat; }
|
||||
|
|
@ -52,7 +53,7 @@ public:
|
|||
|
||||
// Get functions
|
||||
ID3D11ShaderResourceView* getSRView();
|
||||
ID3D11RenderTargetView* getRTView(U32 faceIdx, U32 mipIndex=0);
|
||||
ID3D11RenderTargetView* getRTView(U32 faceIdx);
|
||||
ID3D11DepthStencilView* getDSView();
|
||||
ID3D11Texture2D* get2DTex();
|
||||
|
||||
|
|
@ -63,7 +64,7 @@ private:
|
|||
|
||||
ID3D11Texture2D* mTexture;
|
||||
ID3D11ShaderResourceView* mSRView; // for shader resource input
|
||||
ID3D11RenderTargetView* mRTView[CubeFaces][MaxMipMaps]; // for render targets, 6 faces of the cubemap
|
||||
ID3D11RenderTargetView* mRTView[CubeFaces]; // for render targets, 6 faces of the cubemap
|
||||
ID3D11DepthStencilView* mDSView; //render target view for depth stencil
|
||||
|
||||
bool mAutoGenMips;
|
||||
|
|
|
|||
|
|
@ -217,7 +217,7 @@ void GFXD3D11TextureTarget::attachTexture( RenderSlot slot, GFXCubemap *tex, U32
|
|||
|
||||
mTargets[slot] = cube->get2DTex();
|
||||
mTargets[slot]->AddRef();
|
||||
mTargetViews[slot] = cube->getRTView(face, mipLevel);
|
||||
mTargetViews[slot] = cube->getRTView(face);
|
||||
mTargetViews[slot]->AddRef();
|
||||
mTargetSRViews[slot] = cube->getSRView();
|
||||
mTargetSRViews[slot]->AddRef();
|
||||
|
|
|
|||
|
|
@ -162,6 +162,7 @@ public:
|
|||
void initStatic( GFXTexHandle *faces ) override { };
|
||||
void initStatic( DDSFile *dds ) override { };
|
||||
void initDynamic( U32 texSize, GFXFormat faceFormat = GFXFormatR8G8B8A8, U32 mipLevels = 0) override { };
|
||||
void generateMipMaps() override {}
|
||||
U32 getSize() const override { return 0; }
|
||||
GFXFormat getFormat() const override { return GFXFormatR8G8B8A8; }
|
||||
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
#ifndef _H_IES_LOADER_H_
|
||||
#define _H_IES_LOADER_H_
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ public:
|
|||
/// Returns the size of the faces.
|
||||
virtual U32 getSize() const = 0;
|
||||
|
||||
virtual void generateMipMaps() = 0;
|
||||
/// Returns the face texture format.
|
||||
virtual GFXFormat getFormat() const = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -225,6 +225,10 @@ void GFXGLCubemap::initDynamic(U32 texSize, GFXFormat faceFormat, U32 mipLevels)
|
|||
mInitialized = true;
|
||||
}
|
||||
|
||||
void GFXGLCubemap::generateMipMaps()
|
||||
{
|
||||
}
|
||||
|
||||
void GFXGLCubemap::zombify()
|
||||
{
|
||||
glDeleteTextures(1, &mCubemap);
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ public:
|
|||
void initStatic( GFXTexHandle *faces ) override;
|
||||
void initStatic( DDSFile *dds ) override;
|
||||
void initDynamic( U32 texSize, GFXFormat faceFormat = GFXFormatR8G8B8A8, U32 mipLevels = 0) override;
|
||||
void generateMipMaps() override;
|
||||
U32 getSize() const override { return mWidth; }
|
||||
GFXFormat getFormat() const override { return mFaceFormat; }
|
||||
|
||||
|
|
|
|||
|
|
@ -329,7 +329,8 @@ void ProcessedShaderMaterial::_determineFeatures( U32 stageNum,
|
|||
if (String::compare(LIGHTMGR->getId(), "BLM") == 0)
|
||||
{
|
||||
fd.features.addFeature(MFT_ForwardShading);
|
||||
fd.features.addFeature(MFT_ReflectionProbes);
|
||||
if (!mMaterial->mDynamicCubemap)
|
||||
fd.features.addFeature(MFT_ReflectionProbes);
|
||||
}
|
||||
|
||||
// Disabling the InterlacedDeferred feature for now. It is not ready for prime-time
|
||||
|
|
@ -357,7 +358,8 @@ void ProcessedShaderMaterial::_determineFeatures( U32 stageNum,
|
|||
if (mMaterial->isTranslucent())
|
||||
{
|
||||
fd.features.addFeature(MFT_RTLighting);
|
||||
fd.features.addFeature(MFT_ReflectionProbes);
|
||||
if (!mMaterial->mDynamicCubemap)
|
||||
fd.features.addFeature(MFT_ReflectionProbes);
|
||||
}
|
||||
|
||||
if ( mMaterial->mAnimFlags[stageNum] )
|
||||
|
|
@ -369,7 +371,7 @@ void ProcessedShaderMaterial::_determineFeatures( U32 stageNum,
|
|||
// cubemaps only available on stage 0 for now - bramage
|
||||
if ( stageNum < 1 && mMaterial->isTranslucent() &&
|
||||
( ( mMaterial->mCubemapData && mMaterial->mCubemapData->mCubemap ) ||
|
||||
mMaterial->mDynamicCubemap ) && !features.hasFeature(MFT_ReflectionProbes))
|
||||
mMaterial->mDynamicCubemap ) /*&& !features.hasFeature(MFT_ReflectionProbes) */ )
|
||||
{
|
||||
fd.features.addFeature( MFT_CubeMap );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -618,9 +618,10 @@ void RenderProbeMgr::bakeProbe(ReflectionProbe* probe)
|
|||
clientProbe->mPrefilterMap->mCubemap->initDynamic(resolution, reflectFormat);
|
||||
|
||||
GFXTextureTargetRef renderTarget = GFX->allocRenderToTextureTarget(false);
|
||||
clientProbe->mPrefilterMap->mCubemap = cubeRefl.getCubemap();
|
||||
|
||||
IBLUtilities::GenerateIrradianceMap(renderTarget, cubeRefl.getCubemap(), clientProbe->mIrridianceMap->mCubemap);
|
||||
IBLUtilities::GeneratePrefilterMap(renderTarget, cubeRefl.getCubemap(), prefilterMipLevels, clientProbe->mPrefilterMap->mCubemap);
|
||||
//IBLUtilities::GeneratePrefilterMap(renderTarget, cubeRefl.getCubemap(), prefilterMipLevels, clientProbe->mPrefilterMap->mCubemap);
|
||||
|
||||
U32 endMSTime = Platform::getRealMilliseconds();
|
||||
F32 diffTime = F32(endMSTime - startMSTime);
|
||||
|
|
|
|||
|
|
@ -338,7 +338,8 @@ void CubeReflector::updateReflection( const ReflectParams ¶ms, Point3F expli
|
|||
|
||||
for ( U32 i = 0; i < 6; i++ )
|
||||
updateFace( params, i, explicitPostion);
|
||||
|
||||
|
||||
mCubemap->generateMipMaps();
|
||||
|
||||
GFX->popActiveRenderTarget();
|
||||
|
||||
|
|
@ -531,7 +532,7 @@ F32 PlaneReflector::calcScore( const ReflectParams ¶ms )
|
|||
return score;
|
||||
}
|
||||
|
||||
void PlaneReflector::updateReflection( const ReflectParams ¶ms )
|
||||
void PlaneReflector::updateReflection( const ReflectParams ¶ms, Point3F explicitPostion)
|
||||
{
|
||||
PROFILE_SCOPE(PlaneReflector_updateReflection);
|
||||
GFXDEBUGEVENT_SCOPE( PlaneReflector_updateReflection, ColorI::WHITE );
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ public:
|
|||
|
||||
virtual void unregisterReflector();
|
||||
virtual F32 calcScore( const ReflectParams ¶ms );
|
||||
virtual void updateReflection( const ReflectParams ¶ms ) {}
|
||||
virtual void updateReflection( const ReflectParams ¶ms, Point3F explicitPostion = Point3F::Max) {}
|
||||
|
||||
GFXOcclusionQuery* getOcclusionQuery() const { return mOcclusionQuery; }
|
||||
|
||||
|
|
@ -151,7 +151,7 @@ public:
|
|||
ReflectorDesc *inDesc );
|
||||
|
||||
void unregisterReflector() override;
|
||||
virtual void updateReflection( const ReflectParams ¶ms, Point3F explicitPostion = Point3F::Max);
|
||||
void updateReflection( const ReflectParams ¶ms, Point3F explicitPostion = Point3F::Max) override;
|
||||
|
||||
GFXCubemap* getCubemap() const { return mCubemap; }
|
||||
|
||||
|
|
@ -174,7 +174,7 @@ protected:
|
|||
U32 faceIdx;
|
||||
CubeReflector *cube;
|
||||
|
||||
void updateReflection( const ReflectParams ¶ms ) override { cube->updateFace( params, faceIdx ); }
|
||||
void updateReflection( const ReflectParams ¶ms, Point3F explicitPostion = Point3F::Max) override { cube->updateFace( params, faceIdx ); }
|
||||
F32 calcScore( const ReflectParams ¶ms ) override;
|
||||
};
|
||||
|
||||
|
|
@ -201,7 +201,7 @@ public:
|
|||
ReflectorDesc *inDesc );
|
||||
|
||||
F32 calcScore( const ReflectParams ¶ms ) override;
|
||||
void updateReflection( const ReflectParams ¶ms ) override;
|
||||
void updateReflection( const ReflectParams ¶ms, Point3F explicitPostion = Point3F::Max) override;
|
||||
|
||||
/// Set up the GFX matrices
|
||||
void setGFXMatrices( const MatrixF &camTrans );
|
||||
|
|
@ -233,4 +233,4 @@ public:
|
|||
bool objectSpace;
|
||||
};
|
||||
|
||||
#endif // _REFLECTOR_H_
|
||||
#endif // _REFLECTOR_H_
|
||||
|
|
|
|||
|
|
@ -1922,9 +1922,9 @@ void ReflectCubeFeatGLSL::processPix( Vector<ShaderComponent*> &componentList,
|
|||
Var* matinfo = (Var*) LangElement::find( getOutputTargetVarName(ShaderFeature::RenderTarget2) );
|
||||
Var *roughness = (Var*)LangElement::find("roughness");
|
||||
if (roughness) //try to grab roughness directly
|
||||
texCube = new GenOp("textureLod( @, @, min((1.0 - @)*@ + 1.0, @))", cubeMap, reflectVec, roughness, cubeMips, cubeMips);
|
||||
texCube = new GenOp("textureLod( @, @, min(@*@ + 1.0, @))", cubeMap, reflectVec, roughness, cubeMips, cubeMips);
|
||||
else if (glossColor) //failing that, try and find color data
|
||||
texCube = new GenOp("textureLod( @, @, min((1.0 - @.b)*@ + 1.0, @))", cubeMap, reflectVec, glossColor, cubeMips, cubeMips);
|
||||
texCube = new GenOp("textureLod( @, @, min(@.b*@ + 1.0, @))", cubeMap, reflectVec, glossColor, cubeMips, cubeMips);
|
||||
else //failing *that*, just draw the cubemap
|
||||
texCube = new GenOp("texture( @, @)", cubeMap, reflectVec);
|
||||
|
||||
|
|
|
|||
|
|
@ -1987,11 +1987,11 @@ void ReflectCubeFeatHLSL::processPix( Vector<ShaderComponent*> &componentList,
|
|||
|
||||
if (roughness) //try to grab roughness directly
|
||||
{
|
||||
texCube = new GenOp("@.SampleLevel( @, float3(@).rgb, min((1.0 - @)*@ + 1.0, @))", cubeMapTex, cubeMap, reflectVec, roughness, cubeMips, cubeMips);
|
||||
texCube = new GenOp("@.SampleLevel( @, float3(@).rgb, min(@*@ + 1.0, @))", cubeMapTex, cubeMap, reflectVec, roughness, cubeMips, cubeMips);
|
||||
}
|
||||
else if (glossColor)//failing that, try and find color data
|
||||
{
|
||||
texCube = new GenOp("@.SampleLevel( @, float3(@).rgb, min((1.0 - @.b)*@ + 1.0, @))", cubeMapTex, cubeMap, reflectVec, glossColor, cubeMips, cubeMips);
|
||||
texCube = new GenOp("@.SampleLevel( @, float3(@).rgb, min(@.b*@ + 1.0, @))", cubeMapTex, cubeMap, reflectVec, glossColor, cubeMips, cubeMips);
|
||||
}
|
||||
else //failing *that*, just draw the cubemap
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue