mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 15:44:36 +00:00
Fix: Bit shifting of the 32-bit value with a subsequent expansion to the 64-bit type.
We now shift the 64-bit value, which is now treated correctly.
This commit is contained in:
parent
6275942acb
commit
5c986f755a
2 changed files with 3 additions and 3 deletions
|
|
@ -333,7 +333,7 @@ Var* GBufferConditionerHLSL::_conditionOutput( Var *unconditionedOutput, MultiLi
|
||||||
// Encode depth into two channels
|
// Encode depth into two channels
|
||||||
if(mNormalStorageType != CartesianXYZ)
|
if(mNormalStorageType != CartesianXYZ)
|
||||||
{
|
{
|
||||||
const U64 maxValPerChannel = 1 << mBitsPerChannel;
|
const U64 maxValPerChannel = (U64)1 << mBitsPerChannel;
|
||||||
meta->addStatement( new GenOp( " \r\n // Encode depth into hi/lo\r\n" ) );
|
meta->addStatement( new GenOp( " \r\n // Encode depth into hi/lo\r\n" ) );
|
||||||
meta->addStatement( new GenOp( avar( " float2 _tempDepth = frac(@.a * float2(1.0, %llu.0));\r\n", maxValPerChannel - 1 ),
|
meta->addStatement( new GenOp( avar( " float2 _tempDepth = frac(@.a * float2(1.0, %llu.0));\r\n", maxValPerChannel - 1 ),
|
||||||
unconditionedOutput ) );
|
unconditionedOutput ) );
|
||||||
|
|
@ -391,7 +391,7 @@ Var* GBufferConditionerHLSL::_unconditionInput( Var *conditionedInput, MultiLine
|
||||||
// Recover depth from encoding
|
// Recover depth from encoding
|
||||||
if(mNormalStorageType != CartesianXYZ)
|
if(mNormalStorageType != CartesianXYZ)
|
||||||
{
|
{
|
||||||
const U64 maxValPerChannel = 1 << mBitsPerChannel;
|
const U64 maxValPerChannel = (U64)1 << mBitsPerChannel;
|
||||||
meta->addStatement( new GenOp( " \r\n // Decode depth\r\n" ) );
|
meta->addStatement( new GenOp( " \r\n // Decode depth\r\n" ) );
|
||||||
meta->addStatement( new GenOp( avar( " @.w = dot( @.zw, float2(1.0, 1.0/%llu.0));\r\n", maxValPerChannel - 1 ),
|
meta->addStatement( new GenOp( avar( " @.w = dot( @.zw, float2(1.0, 1.0/%llu.0));\r\n", maxValPerChannel - 1 ),
|
||||||
retVar, conditionedInput ) );
|
retVar, conditionedInput ) );
|
||||||
|
|
|
||||||
|
|
@ -849,7 +849,7 @@ void TerrCell::_updateMaterials()
|
||||||
if ( index == U8_MAX || index > 63 )
|
if ( index == U8_MAX || index > 63 )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
mMaterials |= (U64)(1<<index);
|
mMaterials |= (U64)((U64)1<<index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue