summaryrefslogtreecommitdiff
path: root/indra/newview/llterrainpaintmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llterrainpaintmap.cpp')
-rw-r--r--indra/newview/llterrainpaintmap.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/indra/newview/llterrainpaintmap.cpp b/indra/newview/llterrainpaintmap.cpp
index 8ccde74c93..eeebab1ddb 100644
--- a/indra/newview/llterrainpaintmap.cpp
+++ b/indra/newview/llterrainpaintmap.cpp
@@ -86,9 +86,10 @@ bool LLTerrainPaintMap::bakeHeightNoiseIntoPBRPaintMapRGB(const LLViewerRegion&
return false;
}
gGL.getTexUnit(0)->disable();
- stop_glerror();
- scratch_target.bindTarget();
+ LOG_GLERROR("");
+
+ scratch_target.bindTarget("", 1);
glClearColor(0, 0, 0, 0);
scratch_target.clear();
@@ -107,7 +108,7 @@ bool LLTerrainPaintMap::bakeHeightNoiseIntoPBRPaintMapRGB(const LLViewerRegion&
const LLVector3 region_center = LLVector3(region_half_width, region_half_width, 0.0) + region.getOriginAgent();
const LLVector3 camera_origin = LLVector3(0.0f, 0.0f, region_camera_height) + region_center;
camera.lookAt(camera_origin, region_center, LLVector3::y_axis);
- camera.setAspect(F32(scratch_target.getHeight()) / F32(scratch_target.getWidth()));
+ camera.setAspect(F32(scratch_target.getWidth()) / F32(scratch_target.getHeight()));
const LLRect texture_rect(0, scratch_target.getHeight(), scratch_target.getWidth(), 0);
glViewport(texture_rect.mLeft, texture_rect.mBottom, texture_rect.getWidth(), texture_rect.getHeight());
// Manually get modelview matrix from camera orientation.
@@ -204,8 +205,9 @@ bool LLTerrainPaintMap::bakeHeightNoiseIntoPBRPaintMapRGB(const LLViewerRegion&
{
LLVector3 scratch3;
LLVector3 pos3;
+ LLVector2 tex0_temp;
LLVector2 tex1_temp;
- patch->eval(i, j, stride, &pos3, &scratch3, &tex1_temp);
+ patch->eval(i, j, stride, &pos3, &scratch3, &tex0_temp, &tex1_temp);
(*pos++).set(pos3.mV[VX], pos3.mV[VY], pos3.mV[VZ]);
*tex1++ = tex1_temp;
vertex_total++;
@@ -275,7 +277,7 @@ bool LLTerrainPaintMap::bakeHeightNoiseIntoPBRPaintMapRGB(const LLViewerRegion&
LL_WARNS() << "Failed to copy framebuffer to paintmap" << LL_ENDL;
}
glGenerateMipmap(GL_TEXTURE_2D);
- stop_glerror();
+ LOG_GLERROR("LLTerrainPainMap::bakeHeightNoiseIntoPBRPaintMapRGB() - glGenerateMipmap");
scratch_target.flush();