Browse Source

ShaderTerrainMesh: silently reload texture if it has no RAM image

Fixes #492
rdb 7 years ago
parent
commit
6559932c7b
1 changed files with 3 additions and 1 deletions
  1. 3 1
      panda/src/grutil/shaderTerrainMesh.cxx

+ 3 - 1
panda/src/grutil/shaderTerrainMesh.cxx

@@ -156,7 +156,9 @@ bool ShaderTerrainMesh::generate() {
  *   the chunks, and the PNMImage is destroyed afterwards.
  *   the chunks, and the PNMImage is destroyed afterwards.
  */
  */
 void ShaderTerrainMesh::do_extract_heightfield() {
 void ShaderTerrainMesh::do_extract_heightfield() {
-  nassertv(_heightfield_tex->has_ram_image()); // Heightfield not in RAM, extract ram image first
+  if (!_heightfield_tex->has_ram_image()) {
+    _heightfield_tex->reload();
+  }
 
 
   _heightfield_tex->store(_heightfield);
   _heightfield_tex->store(_heightfield);