Ogre Tutorials: Terrain, Sky and Fog - Terrain::getLayerBlendMap mLayerBlendMapList Segmentation Fault Topic is solved

Problems building or running the engine, queries about how to use features etc.
niceprogrammer
Gnoblar
Posts: 21
Joined: Sat Nov 02, 2024 12:38 pm
x 2

Ogre Tutorials: Terrain, Sky and Fog - Terrain::getLayerBlendMap mLayerBlendMapList Segmentation Fault

Post by niceprogrammer »

Ogre Version: 14.3.4
Operating System: Win 10 64 bit
Render System: RenderSystem_Direct3D11, RenderSystem_GL, RenderSystem_GL3Plus, RenderSystem_GLES2

Hi everyone!

Sorry it is me again.

I am trying to follow this tutorial.
Ogre Tutorials: Terrain, Sky and Fog

I'm working entirely in main.cpp without classes and any GUI-related code, just to quickly experiment with things. I believe my code is very close to the sample code, but I'm encountering a Segmentation Fault in OgreTerrain.cpp. It seems that mLayerBlendMapList isn't being set properly.

Screenshots

Image

Code

Code: Select all

#include <Ogre.h>
#include <OgreApplicationContext.h>
#include <OgreTerrain.h>
#include <OgreTerrainGroup.h>
#include <OgreTrays.h>
#include <string>
#include <OgreTerrainMaterialGeneratorA.h>

#define TERRAIN_PAGE_MIN_X 0
#define TERRAIN_PAGE_MIN_Y 0
#define TERRAIN_PAGE_MAX_X 0
#define TERRAIN_PAGE_MAX_Y 0

#define TERRAIN_FILE_PREFIX std::string("testTerrain")
#define TERRAIN_FILE_SUFFIX std::string("dat")
#define TERRAIN_WORLD_SIZE 12000.0f
#define TERRAIN_SIZE 513

class KeyHandler : public OgreBites::InputListener
{
	bool keyPressed(const OgreBites::KeyboardEvent& evt) override
	{
		if (evt.keysym.sym == OgreBites::SDLK_ESCAPE)
		{
			Ogre::Root::getSingleton().queueEndRendering();
		}
		return true;
	}
};

void configureTerrainDefaults(Ogre::Light* l,
	Ogre::TerrainGroup* mTerrainGroup,
	Ogre::TerrainGlobalOptions* mTerrainGlobals,
	Ogre::SceneManager* mSceneMgr)
{
	//! [configure_lod]
	mTerrainGlobals->setMaxPixelError(8);
	mTerrainGlobals->setCompositeMapDistance(3000);
	//! [configure_lod]

	// mTerrainGlobals->setUseRayBoxDistanceCalculation(true);
	// mTerrainGlobals->getDefaultMaterialGenerator()->setDebugLevel(1);
	// mTerrainGlobals->setLightMapSize(256);

	Ogre::TerrainMaterialGeneratorA::SM2Profile* matProfile = static_cast<Ogre::TerrainMaterialGeneratorA::SM2Profile*>(
		mTerrainGlobals->getDefaultMaterialGenerator()->getActiveProfile());

	// Disable the lightmap for OpenGL ES 2.0. The minimum number of samplers allowed is 8(as opposed to 16 on
	// desktop). Otherwise we will run over the limit by just one. The minimum was raised to 16 in GL ES 3.0.
	if (Ogre::Root::getSingletonPtr()->getRenderSystem()->getCapabilities()->getNumTextureUnits() < 9)
	{
		matProfile->setLightmapEnabled(false);
	}

	// Disable steep parallax by default
	matProfile->setLayerParallaxOcclusionMappingEnabled(false);

	//! [composite_lighting]
	// Important to set these so that the terrain knows what to use for baked (non-realtime) data
	mTerrainGlobals->setLightMapDirection(l->getDerivedDirection());
	mTerrainGlobals->setCompositeMapAmbient(mSceneMgr->getAmbientLight());
	mTerrainGlobals->setCompositeMapDiffuse(l->getDiffuseColour());
	//! [composite_lighting]
	// mTerrainGlobals->setCompositeMapAmbient(ColourValue::Red);

	// Configure default import settings for if we use imported image
	//! [import_settings]
	Ogre::Terrain::ImportData& defaultimp = mTerrainGroup->getDefaultImportSettings();
	defaultimp.inputScale = 600;
	defaultimp.minBatchSize = 33;
	defaultimp.maxBatchSize = 65;
	//! [import_settings]

	//! [tex_from_src]
	Ogre::Image combined;
	combined.loadTwoImagesAsRGBA("Ground23_col.jpg", "Ground23_spec.png", "General");
	Ogre::TextureManager::getSingleton().loadImage("Ground23_diffspec", "General", combined);
	//! [tex_from_src]

	//! [textures]
	defaultimp.layerList.resize(3);
	defaultimp.layerList[0].worldSize = 200;
	defaultimp.layerList[0].textureNames.push_back("Ground37_diffspec.dds");
	defaultimp.layerList[0].textureNames.push_back("Ground37_normheight.dds");
	defaultimp.layerList[1].worldSize = 200;
	defaultimp.layerList[1].textureNames.push_back("Ground23_diffspec"); // loaded from memory
	defaultimp.layerList[1].textureNames.push_back("Ground23_normheight.dds");
	defaultimp.layerList[2].worldSize = 400;
	defaultimp.layerList[2].textureNames.push_back("Rock20_diffspec.dds");
	defaultimp.layerList[2].textureNames.push_back("Rock20_normheight.dds");
	//! [textures]
}

void getTerrainImage(bool flipX, bool flipY, Ogre::Image& img, Ogre::TerrainGroup* mTerrainGroup)
{
	//! [heightmap]
	img.load("terrain.png", mTerrainGroup->getResourceGroup());
	if (flipX)
		img.flipAroundY();
	if (flipY)
		img.flipAroundX();
	//! [heightmap]
}

void defineTerrain(Ogre::TerrainGroup* mTerrainGroup, bool& mTerrainsImported, long x, long y, bool flat = false)
{
	// if a file is available, use it
	// if not, generate file from import

	// Usually in a real project you'll know whether the compact terrain data is
	// available or not; I'm doing it this way to save distribution size

	if (flat)
	{
		mTerrainGroup->defineTerrain(x, y, 0.0f);
		return;
	}

	//! [define]
	std::string filename = mTerrainGroup->generateFilename(x, y);
	if (Ogre::ResourceGroupManager::getSingleton().resourceExists(mTerrainGroup->getResourceGroup(), filename))
	{
		mTerrainGroup->defineTerrain(x, y);
	}
	else
	{
		Ogre::Image img;
		getTerrainImage(x % 2 != 0, y % 2 != 0, img, mTerrainGroup);
		mTerrainGroup->defineTerrain(x, y, &img);
		mTerrainsImported = true;
	}
	//! [define]
}

void initBlendMaps(Ogre::Terrain* terrain)
{
	//! [blendmap]
	using namespace Ogre;
	TerrainLayerBlendMap* blendMap0 = terrain->getLayerBlendMap(1);
	TerrainLayerBlendMap* blendMap1 = terrain->getLayerBlendMap(2);
	float minHeight0 = 20;
	float fadeDist0 = 15;
	float minHeight1 = 70;
	float fadeDist1 = 15;
	float* pBlend0 = blendMap0->getBlendPointer();
	float* pBlend1 = blendMap1->getBlendPointer();
	for (uint16 y = 0; y < terrain->getLayerBlendMapSize(); ++y)
	{
		for (uint16 x = 0; x < terrain->getLayerBlendMapSize(); ++x)
		{
			Real tx, ty;

			blendMap0->convertImageToTerrainSpace(x, y, &tx, &ty);
			float height = terrain->getHeightAtTerrainPosition(tx, ty);

			*pBlend0++ = Math::saturate((height - minHeight0) / fadeDist0);
			*pBlend1++ = Math::saturate((height - minHeight1) / fadeDist1);
		}
	}
	blendMap0->dirty();
	blendMap1->dirty();
	blendMap0->update();
	blendMap1->update();
	//! [blendmap]
	// set up a colour map
	/*
	  if (!terrain->getGlobalColourMapEnabled())
	  {
	  terrain->setGlobalColourMapEnabled(true);
	  Image colourMap;
	  colourMap.load("testcolourmap.jpg", ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
	  terrain->getGlobalColourMap()->loadImage(colourMap);
	  }
	*/
}

int main()
{
	Ogre::Vector3 mTerrainPos = Ogre::Vector3(1000, 0, 5000);
	bool mTerrainsImported;

	OgreBites::ApplicationContext ctx("OgreTutorialApp");
	ctx.initApp();

	// get a pointer to the already created root
	Ogre::Root* root = ctx.getRoot();
	Ogre::SceneManager* mSceneMgr = root->createSceneManager();

	// register our scene with the RTSS
	Ogre::RTShader::ShaderGenerator* shadergen = Ogre::RTShader::ShaderGenerator::getSingletonPtr();
	shadergen->addSceneManager(mSceneMgr);

	// -- tutorial section start --
	//! [cameracreate]
	Ogre::SceneNode* mCameraNode = mSceneMgr->getRootSceneNode()->createChildSceneNode();
	Ogre::Camera* mCamera = mSceneMgr->createCamera("myCam");
	//! [cameracreate]

	mCameraNode->setPosition(mTerrainPos + Ogre::Vector3(1683, 50, 2116));
	mCameraNode->lookAt(Ogre::Vector3(1963, 50, 1660), Ogre::Node::TS_PARENT);
	mCamera->setNearClipDistance(40); // tight near plane important for shadows
	mCamera->setFarClipDistance(50000);
	mCamera->setFarClipDistance(0); // enable infinite far clip distance

	Ogre::Light* l = mSceneMgr->createLight();
	l->setType(Ogre::Light::LT_DIRECTIONAL);
	l->setDiffuseColour(Ogre::ColourValue::White);
	l->setSpecularColour(Ogre::ColourValue(0.4, 0.4, 0.4));

	Ogre::SceneNode* ln = mSceneMgr->getRootSceneNode()->createChildSceneNode();
	ln->setDirection(Ogre::Vector3(0.55, -0.3, 0.75).normalisedCopy());
	ln->attachObject(l);

	Ogre::TerrainGlobalOptions* mTerrainGlobals = new Ogre::TerrainGlobalOptions();
	Ogre::TerrainGroup* mTerrainGroup = new Ogre::TerrainGroup(mSceneMgr, Ogre::Terrain::ALIGN_X_Z, TERRAIN_SIZE, TERRAIN_WORLD_SIZE);
	mTerrainGroup->setFilenameConvention(TERRAIN_FILE_PREFIX, TERRAIN_FILE_SUFFIX);
	mTerrainGroup->setOrigin(mTerrainPos);

	configureTerrainDefaults(l, mTerrainGroup, mTerrainGlobals, mSceneMgr);

	for (long x = TERRAIN_PAGE_MIN_X; x <= TERRAIN_PAGE_MAX_X; ++x)
	{
		for (long y = TERRAIN_PAGE_MIN_Y; y <= TERRAIN_PAGE_MAX_Y; ++y)
		{
			defineTerrain(mTerrainGroup, mTerrainsImported, x, y, false);
		}
	}

	if (mTerrainsImported)
	{
		for (const auto& ti : mTerrainGroup->getTerrainSlots())
		{
			initBlendMaps(ti.second->instance);
		}
	}

	mTerrainGroup->freeTemporaryResources();

	// register for input events
	KeyHandler keyHandler;
	ctx.addInputListener(&keyHandler);

	//mTrayMgr.reset();
	ctx.getRoot()->startRendering();
	ctx.closeApp();

	return 0;
}

Logs

Code: Select all

Creating resource group General
Creating resource group OgreInternal
Creating resource group OgreAutodetect
SceneManagerFactory for type 'DefaultSceneManager' registered.
Registering ResourceManager for type Material
Registering ResourceManager for type Mesh
Registering ResourceManager for type Skeleton
MovableObjectFactory for type 'ParticleSystem' registered.
ArchiveFactory for type 'FileSystem' registered
ArchiveFactory for type 'Zip' registered
ArchiveFactory for type 'EmbeddedZip' registered
DDS codec registering
ETC codec registering
ASTC codec registering
Registering ResourceManager for type GpuProgram
Registering ResourceManager for type Compositor
MovableObjectFactory for type 'Entity' registered.
MovableObjectFactory for type 'Light' registered.
MovableObjectFactory for type 'BillboardSet' registered.
MovableObjectFactory for type 'ManualObject' registered.
MovableObjectFactory for type 'BillboardChain' registered.
MovableObjectFactory for type 'RibbonTrail' registered.
MovableObjectFactory for type 'StaticGeometry' registered.
MovableObjectFactory for type 'Rectangle2D' registered.
Loading library D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/.\RenderSystem_GLES2.dll
Installing plugin: OpenGL ES 2.0 RenderSystem
OpenGL ES 2.x Rendering Subsystem created.
Plugin successfully installed
Loading library D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/.\Plugin_ParticleFX.dll
Installing plugin: ParticleFX
Particle Emitter Type 'Point' registered
Particle Emitter Type 'Box' registered
Particle Emitter Type 'Ellipsoid' registered
Particle Emitter Type 'Cylinder' registered
Particle Emitter Type 'Ring' registered
Particle Emitter Type 'HollowEllipsoid' registered
Particle Affector Type 'LinearForce' registered
Particle Affector Type 'ColourFader' registered
Particle Affector Type 'ColourFader2' registered
Particle Affector Type 'ColourImage' registered
Particle Affector Type 'ColourInterpolator' registered
Particle Affector Type 'Scaler' registered
Particle Affector Type 'Rotator' registered
Particle Affector Type 'DirectionRandomiser' registered
Particle Affector Type 'DeflectorPlane' registered
Particle Affector Type 'TextureAnimator' registered
Plugin successfully installed
Loading library D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/.\Plugin_BSPSceneManager.dll
Installing plugin: BSP Scene Manager
Plugin successfully installed
Loading library D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/.\Codec_STBI.dll
stb_image - v2.30 - public domain image loader
Supported formats: jpeg,jpg,png,bmp,psd,tga,gif,pic,ppm,pgm,hdr
Loading library D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/.\Plugin_PCZSceneManager.dll
Installing plugin: Portal Connected Zone Scene Manager
PCZone Factory Type 'ZoneType_Default' registered
Plugin successfully installed
Loading library D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/.\Plugin_OctreeZone.dll
Installing plugin: Octree Zone Factory
Plugin successfully installed
Loading library D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/.\Plugin_OctreeSceneManager.dll
Installing plugin: Octree Scene Manager
Plugin successfully installed
Loading library D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/.\Plugin_DotScene.dll
Installing plugin: DotScene Loader
Plugin successfully installed
*-*-* OGRE Initialising
*-*-* Version 14.3.4 (Tsathoggua)
OverlayElementFactory for type Panel registered.
OverlayElementFactory for type BorderPanel registered.
OverlayElementFactory for type TextArea registered.
Registering ResourceManager for type Font
CPU Identifier & Features
-------------------------
 *   CPU ID: AuthenticAMD: AMD Ryzen 9 7900 12-Core Processor
 *          SSE: yes
 *         SSE2: yes
 *         SSE3: yes
 *        SSE41: no
 *        SSE42: no
 *          MMX: yes
 *       MMXEXT: yes
 *        3DNOW: no
 *     3DNOWEXT: no
 *         CMOV: yes
 *          TSC: yes
 *INVARIANT TSC: yes
 *          FPU: yes
 *          PRO: yes
 *           HT: no
-------------------------
*** Starting Win32GL Subsystem ***
Registering ResourceManager for type Texture
RenderSystem::_createRenderWindow "OgreTutorialApp", 640x480 windowed  miscParams: FSAA=0 colourDepth= displayFrequency=N/A externalWindowHandle=1247402 gamma=No sdlwin=2180857698960 vsync=Yes vsyncInterval=1
Supported WGL extensions: WGL_ARB_buffer_region WGL_ARB_create_context WGL_ARB_create_context_no_error WGL_ARB_create_context_profile WGL_ARB_create_context_robustness WGL_ARB_context_flush_control WGL_ARB_extensions_string WGL_ARB_make_current_read WGL_ARB_multisample WGL_ARB_pbuffer WGL_ARB_pixel_format WGL_ARB_pixel_format_float WGL_ARB_render_texture WGL_ATI_pixel_format_float WGL_EXT_colorspace WGL_EXT_create_context_es_profile WGL_EXT_create_context_es2_profile WGL_EXT_extensions_string WGL_EXT_framebuffer_sRGB WGL_EXT_pixel_format_packed_float WGL_EXT_swap_control WGL_EXT_swap_control_tear WGL_NVX_DX_interop WGL_NV_DX_interop WGL_NV_DX_interop2 WGL_NV_copy_image WGL_NV_delay_before_swap WGL_NV_float_buffer WGL_NV_multisample_coverage WGL_NV_multigpu_context WGL_NV_render_depth_texture WGL_NV_render_texture_rectangle
GL_VERSION = 3.2.0.0
GL_VENDOR = NVIDIA Corporation
GL_RENDERER = NVIDIA GeForce GTX 750/PCIe/SSE2
GL_EXTENSIONS = GL_EXT_base_instance GL_EXT_blend_func_extended GL_EXT_blend_minmax GL_EXT_buffer_storage GL_EXT_clear_texture GL_EXT_clip_control GL_EXT_clip_cull_distance GL_EXT_color_buffer_float GL_EXT_color_buffer_half_float GL_EXT_conservative_depth GL_EXT_copy_image GL_EXT_depth_clamp GL_EXT_debug_label GL_EXT_discard_framebuffer GL_EXT_disjoint_timer_query GL_EXT_draw_buffers_indexed GL_EXT_draw_elements_base_vertex GL_EXT_EGL_image_external_wrap_modes GL_EXT_float_blend GL_EXT_frag_depth GL_EXT_geometry_point_size GL_EXT_geometry_shader GL_EXT_gpu_shader5 GL_EXT_map_buffer_range GL_EXT_multi_draw_indirect GL_EXT_multisample_compatibility GL_EXT_multiview_texture_multisample GL_EXT_multiview_timer_query GL_EXT_occlusion_query_boolean GL_EXT_polygon_offset_clamp GL_EXT_primitive_bounding_box GL_EXT_render_snorm GL_EXT_robustness GL_EXT_separate_shader_objects GL_EXT_shader_group_vote GL_EXT_shader_implicit_conversions GL_EXT_shader_integer_mix GL_EXT_shader_io_blocks GL_EXT_shader_non_constant_global_initializers GL_EXT_shader_texture_lod GL_EXT_shadow_samplers GL_EXT_sparse_texture GL_EXT_sRGB GL_EXT_sRGB_write_control GL_EXT_tessellation_point_size GL_EXT_tessellation_shader GL_EXT_texture_border_clamp GL_EXT_texture_buffer GL_EXT_texture_compression_bptc GL_EXT_texture_compression_dxt1 GL_EXT_texture_compression_rgtc GL_EXT_texture_compression_s3tc GL_EXT_texture_cube_map_array GL_EXT_texture_filter_anisotropic GL_EXT_texture_format_BGRA8888 GL_EXT_texture_mirror_clamp_to_edge GL_EXT_texture_norm16 GL_EXT_texture_query_lod GL_EXT_texture_rg GL_EXT_texture_shadow_lod GL_EXT_texture_sRGB_R8 GL_EXT_texture_sRGB_decode GL_EXT_texture_storage GL_EXT_texture_view GL_EXT_draw_transform_feedback GL_EXT_unpack_subimage GL_EXT_window_rectangles GL_KHR_context_flush_control GL_KHR_debug GL_EXT_memory_object GL_EXT_memory_object_win32 GL_EXT_win32_keyed_mutex GL_KHR_parallel_shader_compile GL_KHR_no_error GL_KHR_robust_buffer_access_behavior GL_KHR_robustness GL_EXT_semaphore GL_EXT_semaphore_win32 GL_NV_timeline_semaphore GL_KHR_shader_subgroup GL_KHR_texture_compression_astc_ldr GL_KHR_texture_compression_astc_sliced_3d GL_KHR_texture_compression_astc_hdr GL_NV_bgr GL_NV_bindless_texture GL_NV_blend_equation_advanced GL_NV_blend_equation_advanced_coherent GL_NV_blend_minmax_factor GL_NV_conditional_render GL_NV_copy_buffer GL_NV_copy_image GL_NV_draw_buffers GL_NV_draw_instanced GL_NV_draw_texture GL_NV_draw_vulkan_image GL_NV_explicit_attrib_location GL_NV_fbo_color_attachments GL_NV_framebuffer_blit GL_NV_framebuffer_multisample GL_NV_generate_mipmap_sRGB GL_NV_instanced_arrays GL_NV_internalformat_sample_query GL_NV_gpu_shader5 GL_NV_image_formats GL_NV_occlusion_query_samples GL_NV_non_square_matrices GL_NV_pack_subimage GL_NV_packed_float GL_NV_packed_float_linear GL_NV_path_rendering GL_NV_pixel_buffer_object GL_NV_polygon_mode GL_NV_read_buffer GL_NV_read_depth GL_NV_read_depth_stencil GL_NV_read_stencil GL_NV_shader_noperspective_interpolation GL_NV_shader_subgroup_partitioned GL_NV_shadow_samplers_array GL_NV_shadow_samplers_cube GL_NV_sRGB_formats GL_NV_texture_array GL_NV_texture_barrier GL_NV_texture_border_clamp GL_NV_texture_compression_latc GL_NV_texture_compression_s3tc GL_NV_texture_compression_s3tc_update GL_NV_timer_query GL_NV_viewport_array GL_KHR_blend_equation_advanced GL_KHR_blend_equation_advanced_coherent GL_OES_compressed_ETC1_RGB8_texture GL_EXT_compressed_ETC1_RGB8_sub_texture GL_OES_depth24 GL_OES_depth32 GL_OES_depth_texture GL_OES_depth_texture_cube_map GL_OES_copy_image GL_OES_draw_buffers_indexed GL_OES_draw_elements_base_vertex GL_OES_texture_border_clamp GL_OES_tessellation_point_size GL_OES_tessellation_shader GL_OES_texture_buffer GL_OES_geometry_point_size GL_OES_geometry_shader GL_OES_gpu_shader5 GL_OES_shader_io_blocks GL_OES_texture_view GL_OES_primitive_bounding_box GL_OES_element_index_uint GL_OES_fbo_render_mipmap GL_OES_get_program_binary GL_OES_mapbuffer GL_OES_packed_depth_stencil GL_OES_rgb8_rgba8 GL_EXT_read_format_bgra GL_OES_sample_shading GL_OES_sample_variables GL_OES_shader_image_atomic GL_OES_shader_multisample_interpolation GL_OES_standard_derivatives GL_OES_texture_cube_map_array GL_OES_texture_npot GL_OES_texture_float GL_OES_texture_float_linear GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_texture_stencil8 GL_OES_texture_storage_multisample_2d_array GL_OES_vertex_array_object GL_OES_vertex_half_float GL_OES_viewport_array GL_OVR_multiview GL_OVR_multiview2 GL_ANDROID_extension_pack_es31a
**************************************
*** OpenGL ES 2.x Renderer Started ***
**************************************
Shading language version: OpenGL ES GLSL ES 3.20
FBO PF_L8 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_A8 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_BYTE_LA depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_R5G6B5 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_A4R4G4B4 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_A1R5G5B5 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_B8G8R8 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_A8B8G8R8 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_A2B10G10R10 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_FLOAT16_RGB depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_FLOAT16_RGBA depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_FLOAT32_RGBA depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_X8B8G8R8 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_DEPTH16 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_FLOAT16_R depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_FLOAT32_R depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_FLOAT16_GR depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_FLOAT32_GR depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_R11G11B10_FLOAT depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_R8_UINT depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_R8G8_UINT depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_R8G8B8A8_UINT depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_R16_UINT depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_R16G16_UINT depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_R16G16B16A16_UINT depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_R32_UINT depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_R32G32_UINT depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_R32G32B32A32_UINT depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_R8_SINT depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_R8G8_SINT depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_R8G8B8A8_SINT depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_R16_SINT depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_R16G16_SINT depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_R16G16B16A16_SINT depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_R32_SINT depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_R32G32_SINT depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_R32G32B32A32_SINT depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_R8 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
FBO PF_R8G8 depth/stencil support: D0S0 D0S8 D16S0 D24S0 D32S0 Packed-D24S8 Packed-D32S8
[GLES2] : Valid FBO targets PF_L8 PF_A8 PF_BYTE_LA PF_R5G6B5 PF_A4R4G4B4 PF_A1R5G5B5 PF_B8G8R8 PF_A8B8G8R8 PF_A2B10G10R10 PF_FLOAT16_RGB PF_FLOAT16_RGBA PF_FLOAT32_RGBA PF_X8B8G8R8 PF_DEPTH16 PF_FLOAT16_R PF_FLOAT32_R PF_FLOAT16_GR PF_FLOAT32_GR PF_R11G11B10_FLOAT PF_R8_UINT PF_R8G8_UINT PF_R8G8B8A8_UINT PF_R16_UINT PF_R16G16_UINT PF_R16G16B16A16_UINT PF_R32_UINT PF_R32G32_UINT PF_R32G32B32A32_UINT PF_R8_SINT PF_R8G8_SINT PF_R8G8B8A8_SINT PF_R16_SINT PF_R16G16_SINT PF_R16G16B16A16_SINT PF_R32_SINT PF_R32G32_SINT PF_R32G32B32A32_SINT PF_R8 PF_R8G8
RenderSystem capabilities
-------------------------
RenderSystem Name: OpenGL ES 2.x Rendering Subsystem
GPU Vendor: nvidia
Device Name: NVIDIA GeForce GTX 750/PCIe/SSE2
Driver Version: 3.2.0.0
 * Fixed function pipeline: no
 * 32-bit index buffers: yes
 * Hardware stencil buffer: yes
   - Two sided stencil support: yes
   - Wrap stencil values: yes
 * Gpu programs: yes
   - Vertex constant 4-vectors: 1024
   - Fragment constant 4-vectors: 1024
 * Geometry programs: no
 * Tessellation programs: no
 * Mesh programs: no
 * Compute programs: no
 * Supported Shader Profiles: glsl300es glsl310es glsl320es glsles
 * Read-back compiled shader: yes
 * Number of vertex attributes: 16
 * Textures
   - Number of texture units: 16
   - Number of vertex textures: 0
   - Floating point: yes
   - Non-power-of-two: yes
   - 1D textures: no
   - 2D array textures: yes
   - 3D textures: yes
   - Anisotropic filtering: yes
 * Texture Compression: yes
   - DXT: yes
   - VTC: no
   - PVRTC: no
   - ATC: no
   - ETC1: yes
   - ETC2: yes
   - BC4/BC5: no
   - BC6H/BC7: no
   - ASTC: yes
   - Automatic mipmap generation: no
 * Vertex Buffers
   - Render to Vertex Buffer: yes
   - Instance Data: yes
   - Primitive Restart: yes
   - INT_10_10_10_2_NORM element type: yes
   - 16x3 element types: yes
 * Read/Write Buffers: no
 * Hardware Occlusion Query: yes
 * User clip planes: no
 * Depth clamping: no
 * Hardware render-to-texture: yes
   - Multiple Render Targets: 8
 * Point Sprites: yes
   - Max Size: 0
 * Wide Lines: yes
 * Hardware Gamma: yes
 * PBuffer support: no
 * Vertex Array Objects: yes
 * Separate shader objects: no
   - redeclare GLSL interface block: no
 * Debugging/ profiling events: no
 * Map buffer storage: yes
DefaultWorkQueue('Root') initialising on thread 15908.
Particle Renderer Type 'billboard' registered
SceneManagerFactory for type 'BspSceneManager' registered.DefaultWorkQueue('Root')::WorkerFunc - thread 18352 starting.

DefaultWorkQueue('Root')::WorkerFunc - thread 15556 starting.SceneManagerFactory for type 'PCZSceneManager' registered.

MovableObjectFactory for type 'PCZLight' registered.
MovableObjectFactory for type 'Portal' registered.
MovableObjectFactory for type 'AntiPortal' registered.
PCZone Factory Type 'ZoneType_Octree' registered
SceneManagerFactory for type 'OctreeSceneManager' registered.
Parsing 'D:\Projects\Ogre3D\Project4_Terrain_Sky_and_Fog_2\output\RelWithDebInfo\resources.cfg'
Creating resource group BSPWorld
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/packs/oa_rpg3dm2.pk3' of type 'Zip' to resource group 'BSPWorld'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/packs/ogretestmap.zip' of type 'Zip' to resource group 'BSPWorld'
Creating resource group Essential
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/thumbnails' of type 'FileSystem' to resource group 'Essential'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/packs/SdkTrays.zip' of type 'Zip' to resource group 'Essential'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/packs/profiler.zip' of type 'Zip' to resource group 'Essential'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/PBR' of type 'FileSystem' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/PBR/filament' of type 'FileSystem' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/materials/programs/GLSL' of type 'FileSystem' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/materials/programs/GLSL120' of type 'FileSystem' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/materials/programs/GLSL150' of type 'FileSystem' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/materials/programs/GLSL400' of type 'FileSystem' to resource group 'General'
Warning: Skipping 'HW_VTFInstancing.vert' because it already exists in resource group 'General'
Warning: Skipping 'Instancing.frag' because it already exists in resource group 'General'
Warning: Skipping 'VTFInstancing.vert' because it already exists in resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/materials/programs/GLSLES' of type 'FileSystem' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/materials/programs/SPIRV' of type 'FileSystem' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/materials/programs/Cg' of type 'FileSystem' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/materials/programs/HLSL' of type 'FileSystem' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/materials/programs/HLSL_Cg' of type 'FileSystem' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/materials/scripts' of type 'FileSystem' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/materials/textures' of type 'FileSystem' to resource group 'General'
Warning: Skipping 'README.md' because it already exists in resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/materials/textures/terrain' of type 'FileSystem' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/models' of type 'FileSystem' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/particle' of type 'FileSystem' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/DeferredShadingMedia' of type 'FileSystem' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/DeferredShadingMedia/DeferredShading/post' of type 'FileSystem' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/PCZAppMedia' of type 'FileSystem' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/materials/scripts/SSAO' of type 'FileSystem' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/materials/textures/SSAO' of type 'FileSystem' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/volumeTerrain' of type 'FileSystem' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/CSMShadows' of type 'FileSystem' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/packs/cubemap.zip' of type 'Zip' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/packs/cubemapsJS.zip' of type 'Zip' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/packs/dragon.zip' of type 'Zip' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/packs/fresneldemo.zip' of type 'Zip' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/packs/ogredance.zip' of type 'Zip' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/packs/Sinbad.zip' of type 'Zip' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/packs/skybox.zip' of type 'Zip' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/volumeTerrain/volumeTerrainBig.zip' of type 'Zip' to resource group 'General'
Warning: Skipping 'README.txt' because it already exists in resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/packs/DamagedHelmet.zip' of type 'Zip' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/packs/filament_shaders.zip' of type 'Zip' to resource group 'General'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/Main' of type 'FileSystem' to resource group 'OgreInternal'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/RTShaderLib' of type 'FileSystem' to resource group 'OgreInternal'
Added resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/../Media/Terrain/' of type 'FileSystem' to resource group 'OgreInternal'
Warning: resource location 'D:/Projects/Ogre3D/Project4_Terrain_Sky_and_Fog_2/output/RelWithDebInfo/.../Tests/Media' does not exist - skipping
Parsing scripts for resource group BSPWorld
Parsing script scripts/clown.shader
Parsing script scripts/liquid_water.shader
Parsing script scripts/oalite.shader
Parsing script scripts/oanew.shader
Parsing script scripts/oasky.shader
Finished parsing scripts for resource group BSPWorld
Creating resources for group BSPWorld
All done
Parsing scripts for resource group Essential
Parsing script SdkTrays.material
Parsing script OgreProfiler.material
Parsing script SdkTrays.fontdef
Parsing script SdkTrays.overlay
Texture 'sdk_cursor.png': Loading 1 faces(PF_A8B8G8R8,32x32x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8B8G8R8,32x32x1.
Texture 'sdk_tray.png': Loading 1 faces(PF_A8B8G8R8,64x64x1) with 6 hardware generated mipmaps from Image. Internal format is PF_A8B8G8R8,64x64x1.
Texture 'sdk_button_up.png': Loading 1 faces(PF_A8B8G8R8,128x32x1) with 7 hardware generated mipmaps from Image. Internal format is PF_A8B8G8R8,128x32x1.
Texture 'sdk_text_box.png': Loading 1 faces(PF_A8B8G8R8,32x32x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8B8G8R8,32x32x1.
Texture 'sdk_mini_tray.png': Loading 1 faces(PF_A8B8G8R8,32x32x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8B8G8R8,32x32x1.
Texture 'sdk_track.png': Loading 1 faces(PF_A8B8G8R8,16x32x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8B8G8R8,16x32x1.
Texture 'sdk_handle.png': Loading 1 faces(PF_A8B8G8R8,16x16x1) with 4 hardware generated mipmaps from Image. Internal format is PF_A8B8G8R8,16x16x1.
Texture 'sdk_mini_text_box.png': Loading 1 faces(PF_A8B8G8R8,32x32x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8B8G8R8,32x32x1.
Texture 'sdk_label.png': Loading 1 faces(PF_A8B8G8R8,32x32x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8B8G8R8,32x32x1.
Texture 'sdk_separator.png': Loading 1 faces(PF_A8B8G8R8,64x16x1) with 6 hardware generated mipmaps from Image. Internal format is PF_A8B8G8R8,64x16x1.
Texture 'sdk_logo.png': Loading 1 faces(PF_A8B8G8R8,128x64x1) with 7 hardware generated mipmaps from Image. Internal format is PF_A8B8G8R8,128x64x1.
Texture 'sdk_shade.png': Loading 1 faces(PF_A8B8G8R8,64x48x1) with 6 hardware generated mipmaps from Image. Internal format is PF_A8B8G8R8,64x48x1.
Texture 'sdk_frame.png': Loading 1 faces(PF_A8B8G8R8,32x32x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8B8G8R8,32x32x1.
Texture 'sdk_mini_text_box_over.png': Loading 1 faces(PF_A8B8G8R8,32x32x1) with 5 hardware generated mipmaps from Image. Internal format is PF_A8B8G8R8,32x32x1.
Texture 'sdk_pulse.png': Loading 1 faces(PF_B8G8R8,8x1x1) with 3 hardware generated mipmaps from Image. Internal format is PF_B8G8R8,8x1x1.
Finished parsing scripts for resource group Essential
Creating resources for group Essential
All done
Parsing scripts for resource group General
Parsing script pbr.program
Parsing script pbr_filament.program
Parsing script Examples.program
Parsing script Instancing.program
Parsing script StdQuad_vp.program
Parsing script deferred_post.program
Parsing script ShadowCaster.program
Parsing script glTF2_PBR.material
Error: ScriptCompiler - invalid parameters in glTF2_PBR.material(37): overriding previous declarations of texture 'black.png' with different parameters
Parsing script filament.material
Parsing script AdaptivePNTrianglesTessellation.material
Parsing script AdvancedGLSL.material
Parsing script ASCII.material
Parsing script BlackAndWhite.material
Parsing script Bloom2.material
Parsing script Compute.material
Parsing script DamagedHelmet.material
Parsing script DepthShadowmap.material
Parsing script Dither.material
Parsing script DOF.material
Parsing script Embossed.material
Parsing script Examples-Advanced.material
Parsing script Examples-DynTex.material
Parsing script Examples-Water.material
Error: ScriptCompiler - invalid parameters in Examples-Water.material(130): overriding previous declarations of texture 'studio_garden.jpg' with different parameters
Parsing script Examples.material
Parsing script facial.material
Parsing script FluidSim.material
Parsing script gaussiansplat.material
Parsing script Glass.material
Parsing script Hair.material
Parsing script Halftone.material
Parsing script HardwareSkinningShadow.material
Parsing script hdr.material
Parsing script HeatVision.material
Parsing script HWInstancing.material
Parsing script HW_VTFInstancing.material
Parsing script HW_VTF_LUTInstancing.material
Parsing script Invert.material
Parsing script Island.material
Parsing script IsoSurf.material
Parsing script Laplace.material
Parsing script LigthShafts.material
Parsing script MotionBlur.material
Parsing script NightVision.material
Parsing script Ocean.material
Parsing script OffsetMapping.material
Parsing script Ogre.material
Parsing script OldMovie.material
Parsing script OldTV.material
Parsing script ParticleGS.material
Parsing script Posterize.material
Parsing script pssm.material
Parsing script RadialBlur.material
Parsing script RTShaderSystem.material
Parsing script ShaderInstancing.material
Parsing script SharpenEdges.material
Parsing script ShowVertexAttributes.material
Parsing script sibenik.material
Parsing script smoke.material
Parsing script TerrainTessellation.material
Parsing script Tessellation.material
Parsing script Tiling.material
Parsing script VTFInstancing.material
Parsing script WBOIT.material
Parsing script deferreddemo.material
Parsing script deferred_post.material
Parsing script deferred_post_minilight.material
Parsing script ShadowCaster.material
Parsing script ssao.material
Parsing script ROOM.material
Parsing script CreaseShading.material
Parsing script Crytek.material
Parsing script GBuffer.material
Parsing script HemisphereMC.material
Parsing script HorizonBased.material
Parsing script Modulate.material
Parsing script ShowDepth.material
Parsing script ShowNormals.material
Parsing script ShowViewPos.material
Parsing script SSAOPost.material
Parsing script UnsharpMask.material
Parsing script Volumetric.material
Parsing script triplanarReference.material
Parsing script CSMShadows.material
Parsing script RomanBath.material
Parsing script Sinbad.material
Parsing script emitted_emitter.particle
Parsing script Examples-Water.particle
Parsing script Examples.particle
Parsing script smoke.particle
Parsing script Examples.compositor
Parsing script deferred.compositor
Parsing script ssao.compositor
Parsing script SSAO.compositor
Parsing script SSAOPost.compositor
Finished parsing scripts for resource group General
Creating resources for group General
All done
Parsing scripts for resource group OgreAutodetect
Finished parsing scripts for resource group OgreAutodetect
Creating resources for group OgreAutodetect
All done
Parsing scripts for resource group OgreInternal
Parsing script ShadowVolumeExtude.program
Parsing script Shadow.material
Parsing script RTSSamplers.material
Finished parsing scripts for resource group OgreInternal
Creating resources for group OgreInternal
All done
Texture 'Ground23_diffspec': Loading 1 faces(PF_A8B8G8R8,1024x1024x1) with 10 hardware generated mipmaps from Image. Internal format is PF_A8B8G8R8,1024x1024x1.
Segmentation fault
Last edited by niceprogrammer on Sat Mar 15, 2025 7:52 pm, edited 1 time in total.
User avatar
Arthurfernandes
Kobold
Posts: 37
Joined: Mon Oct 28, 2024 10:50 pm
x 5

Re: Ogre Tutorials: Terrain, Sky and Fog - Terrain::getLayerBlendMap mLayerBlendMapList Segmentation Fault

Post by Arthurfernandes »

Can you post the entire terrain initialization code? It's possible that your variable is not initialized because it is null when trying to access the method size.

niceprogrammer
Gnoblar
Posts: 21
Joined: Sat Nov 02, 2024 12:38 pm
x 2

Re: Ogre Tutorials: Terrain, Sky and Fog - Terrain::getLayerBlendMap mLayerBlendMapList Segmentation Fault

Post by niceprogrammer »

Thanks for responding!

All of the codes are pasted above.

niceprogrammer
Gnoblar
Posts: 21
Joined: Sat Nov 02, 2024 12:38 pm
x 2

Re: Ogre Tutorials: Terrain, Sky and Fog - Terrain::getLayerBlendMap mLayerBlendMapList Segmentation Fault

Post by niceprogrammer »

Anyone? :)

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 495
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 179

Re: Ogre Tutorials: Terrain, Sky and Fog - Terrain::getLayerBlendMap mLayerBlendMapList Segmentation Fault

Post by sercero »

Can you produce a stack trace so we can see what is the problem?

I never used terrain so by looking at the code its impossible at least for me to help you.

niceprogrammer
Gnoblar
Posts: 21
Joined: Sat Nov 02, 2024 12:38 pm
x 2

Re: Ogre Tutorials: Terrain, Sky and Fog - Terrain::getLayerBlendMap mLayerBlendMapList Segmentation Fault

Post by niceprogrammer »

I am not sure if this is sufficient. This is all I get after switching to Debug ogre build.

Image

Code: Select all

>	OgreTerrain_d.dll!std::vector<Ogre::TerrainLayerBlendMap *,std::allocator<Ogre::TerrainLayerBlendMap *>>::size() Line 1900	C++
 	OgreTerrain_d.dll!Ogre::Terrain::getLayerBlendMap(unsigned char layerIndex) Line 2656	C++
 	Project3.exe!initBlendMaps(Ogre::Terrain * terrain) Line 139	C++
 	Project3.exe!main() Line 233	C++
 	Project3.exe!invoke_main() Line 79	C++
 	Project3.exe!__scrt_common_main_seh() Line 288	C++
 	Project3.exe!__scrt_common_main() Line 331	C++
 	Project3.exe!mainCRTStartup(void * __formal) Line 17	C++
 	kernel32.dll!00007ffed5737374()	Unknown
 	ntdll.dll!00007ffed589cc91()	Unknown

The error failed when calling terrain->getLayerBlendMap.

Code: Select all

void initBlendMaps(Ogre::Terrain* terrain)
{
	//! [blendmap]
	using namespace Ogre;
	TerrainLayerBlendMap* blendMap0 = terrain->getLayerBlendMap(1); // <---
rpgplayerrobin
Orc Shaman
Posts: 723
Joined: Wed Mar 18, 2009 3:03 am
x 401

Re: Ogre Tutorials: Terrain, Sky and Fog - Terrain::getLayerBlendMap mLayerBlendMapList Segmentation Fault

Post by rpgplayerrobin »

I have never used the terrain either, so my help might be limited.

But your image shows that mLayerBlendMapList is "???", which most likely means that the getLayerBlendMap was called with a NULL or invalid pointer.
Have you debugged the code to see if the terrain variable is valid?

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 495
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 179

Re: Ogre Tutorials: Terrain, Sky and Fog - Terrain::getLayerBlendMap mLayerBlendMapList Segmentation Fault

Post by sercero »

Code: Select all

	Ogre::TerrainGlobalOptions* mTerrainGlobals = new Ogre::TerrainGlobalOptions();
	Ogre::TerrainGroup* mTerrainGroup = new Ogre::TerrainGroup(mSceneMgr, Ogre::Terrain::ALIGN_X_Z, TERRAIN_SIZE, TERRAIN_WORLD_SIZE);
	mTerrainGroup->setFilenameConvention(TERRAIN_FILE_PREFIX, TERRAIN_FILE_SUFFIX);
	mTerrainGroup->setOrigin(mTerrainPos);

configureTerrainDefaults(l, mTerrainGroup, mTerrainGlobals, mSceneMgr);

for (long x = TERRAIN_PAGE_MIN_X; x <= TERRAIN_PAGE_MAX_X; ++x)
{
	for (long y = TERRAIN_PAGE_MIN_Y; y <= TERRAIN_PAGE_MAX_Y; ++y)
	{
		defineTerrain(mTerrainGroup, mTerrainsImported, x, y, false);
	}
}

if (mTerrainsImported)
{
	for (const auto& ti : mTerrainGroup->getTerrainSlots())
	{
		initBlendMaps(ti.second->instance);
	}
}

I am guessing that the problem is here.

In your initialization code you did not set the blend maps anywhere.

I think that there are probably some missing initializations for "mTerrainGroup".

User avatar
sercero
Bronze Sponsor
Bronze Sponsor
Posts: 495
Joined: Sun Jan 18, 2015 4:20 pm
Location: Buenos Aires, Argentina
x 179

Re: Ogre Tutorials: Terrain, Sky and Fog - Terrain::getLayerBlendMap mLayerBlendMapList Segmentation Fault

Post by sercero »

Check out the code here: viewtopic.php?p=550420&hilit=initBlendMaps#p550420

It seems more complete.

niceprogrammer
Gnoblar
Posts: 21
Joined: Sat Nov 02, 2024 12:38 pm
x 2

Re: Ogre Tutorials: Terrain, Sky and Fog - Terrain::getLayerBlendMap mLayerBlendMapList Segmentation Fault

Post by niceprogrammer »

Thanks!

I was able to make it work by checking the difference when the codes from your link.

2 things I missed

  1. I missed the mTerrainGroup->loadAllTerrains(true); after the defineTerrain loop.

    Code: Select all

    // sync load since we want everything in place when we start
    mTerrainGroup->loadAllTerrains(true);

    After adding this the error went away and I got a black screen.

  2. I missed creating a viewport. I was following the Tutorial and Viewport in the Terrain tutorial section. It was only mentioned in the Fog section.

    Code: Select all

    Ogre::Viewport* vp = ctx.getRenderWindow()->addViewport(mCamera);
    vp->setBackgroundColour(Ogre::ColourValue::White);

    After adding this I got it working

Image