mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-13 10:49:11 +00:00
Small adjustment to landscape vp parameter setting
This commit is contained in:
parent
54ccd5d129
commit
7f02dc6a5f
1 changed files with 19 additions and 15 deletions
|
@ -1198,11 +1198,14 @@ void CLandscape::render(const CVector &refineCenter, const CVector &frontVecto
|
|||
bool uprogstate = driver->isUniformProgramState();
|
||||
uint nbvp = uprogstate ? CLandscapeVBAllocator::MaxVertexProgram : 1;
|
||||
for (uint i = 0; i < nbvp; ++i)
|
||||
{
|
||||
CVertexProgramLandscape *program = _TileVB.getVP(i);
|
||||
if (program)
|
||||
{
|
||||
// activate the program to set the uniforms in the program state for all programs
|
||||
// note: when uniforms are driver state, the indices must be the same across programs
|
||||
if (uprogstate) _TileVB.activateVP(i);
|
||||
CVertexProgramLandscape *program = _TileVB.getVP(i);
|
||||
|
||||
// c[0..3] take the ModelViewProjection Matrix.
|
||||
driver->setUniformMatrix(IDriver::VertexProgram, program->getUniformIndex(CGPUProgramIndex::ModelViewProjection), IDriver::ModelViewProjection, IDriver::Identity);
|
||||
// c[4] take useful constants.
|
||||
|
@ -1217,6 +1220,7 @@ void CLandscape::render(const CVector &refineCenter, const CVector &frontVecto
|
|||
driver->setUniform3f(IDriver::VertexProgram, program->idx().PZBModelPosition, _PZBModelPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 1. TileRender pass.
|
||||
|
|
Loading…
Reference in a new issue