Uranday
03-09-2013 20:48:05
Hi
Im trying to make a skybox. To do this I created a simple program. Though I think i did everything the way it is supposed, I cannot get it to work.
I have a folder structure with
\Media\Materials\Scripts\Skybox.Material
\Media\SkyMap\skybox.zip
This is the content of the material file
these files are in the skybox.zip
This is my resource config file
And this is my application
And this is my log file
I hope someone can point me out what I'm doing wrong.
Patrick
Im trying to make a skybox. To do this I created a simple program. Though I think i did everything the way it is supposed, I cannot get it to work.
I have a folder structure with
\Media\Materials\Scripts\Skybox.Material
\Media\SkyMap\skybox.zip
This is the content of the material file
material Examples/SpaceSkyBox
{
technique
{
pass
{
lighting off
depth_write off
\Materials
texture_unit
{
cubic_texture stevecube.jpg separateUV
tex_address_mode clamp
}
}
}
}
these files are in the skybox.zip
stevecube_{x}.jpg x=BK, DN, FR, LF, RT, UP
This is my resource config file
[General]
FileSystem = Media/Scripts
Zip = Media/SkyMap/skybox.zip
And this is my application
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using Mogre;
namespace geviewer
{
static class Program
{
static Root mRoot;
static RenderWindow mRenderWindow;
static float mTimer = 5;
public static void Main()
{
mRoot = new Root();
CreateRoot();
DefineResources();
CreateRenderSystem();
CreateRenderWindow();
InitializeResources();
CreateScene();
CreateFrameListeners();
EnterRenderLoop();
}
private static void InitializeResources()
{
TextureManager.Singleton.DefaultNumMipmaps = 5;
ResourceGroupManager.Singleton.InitialiseAllResourceGroups();
}
private static void DefineResources()
{
ConfigFile cf = new ConfigFile();
cf.Load("resources.cfg", "\t:=", true);
var section = cf.GetSectionIterator();
while (section.MoveNext())
{
foreach (var line in section.Current)
{
ResourceGroupManager.Singleton.AddResourceLocation(
line.Value, line.Key, section.CurrentKey);
}
}
}
private static void CreateScene()
{
SceneManager sceneMgr = mRoot.CreateSceneManager(SceneType.ST_GENERIC);
Camera camera = sceneMgr.CreateCamera("Camera");
camera.Position = new Vector3(0, 0, 150);
camera.LookAt(Vector3.ZERO);
mRenderWindow.AddViewport(camera);
sceneMgr.SetSkyBox(true, "Examples/SpaceSkyBox");
}
private static void CreateRenderSystem()
{
RenderSystem renderSystem = mRoot.GetRenderSystemByName("Direct3D9 Rendering Subsystem");
renderSystem.SetConfigOption("Full Screen", "No");
renderSystem.SetConfigOption("Video Mode", "800 x 600 @ 32-bit colour");
mRoot.RenderSystem = renderSystem;
}
private static void CreateRoot()
{
mRoot = new Root("");
mRoot.LoadPlugin("RenderSystem_Direct3D9");
mRoot.LoadPlugin("RenderSystem_GL");
mRoot.LoadPlugin("Plugin_OctreeSceneManager");
}
static void CreateRenderWindow()
{
mRenderWindow = mRoot.Initialise(true, "Main Ogre Window");
}
static void CreateFrameListeners()
{
mRoot.FrameRenderingQueued += new FrameListener.FrameRenderingQueuedHandler(OnFrameRenderingQueued);
}
static bool OnFrameRenderingQueued(FrameEvent evt)
{
mTimer -= evt.timeSinceLastFrame;
return (mTimer > 0);
}
static void EnterRenderLoop()
{
mRoot.StartRendering();
}
}
}
And this is my log file
21:47:28: Creating resource group General
21:47:28: Creating resource group Internal
21:47:28: Creating resource group Autodetect
21:47:28: SceneManagerFactory for type 'DefaultSceneManager' registered.
21:47:28: Registering ResourceManager for type Material
21:47:28: Registering ResourceManager for type Mesh
21:47:28: Registering ResourceManager for type Skeleton
21:47:28: MovableObjectFactory for type 'ParticleSystem' registered.
21:47:28: OverlayElementFactory for type Panel registered.
21:47:28: OverlayElementFactory for type BorderPanel registered.
21:47:28: OverlayElementFactory for type TextArea registered.
21:47:28: Registering ResourceManager for type Font
21:47:28: ArchiveFactory for archive type FileSystem registered.
21:47:28: ArchiveFactory for archive type Zip registered.
21:47:28: DDS codec registering
21:47:28: FreeImage version: 3.15.3
21:47:28: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
21:47:28: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,exr,j2k,j2c,jp2,pfm,pct,pict,pic,3fr,arw,bay,bmq,cap,cine,cr2,crw,cs1,dc2,dcr,drf,dsc,dng,erf,fff,ia,iiq,k25,kc2,kdc,mdc,mef,mos,mrw,nef,nrw,orf,pef,ptx,pxn,qtk,raf,raw,rdc,rw2,rwl,rwz,sr2,srf,srw,sti
21:47:28: PVRTC codec registering
21:47:28: Registering ResourceManager for type HighLevelGpuProgram
21:47:28: Registering ResourceManager for type Compositor
21:47:28: MovableObjectFactory for type 'Entity' registered.
21:47:28: MovableObjectFactory for type 'Light' registered.
21:47:28: MovableObjectFactory for type 'BillboardSet' registered.
21:47:28: MovableObjectFactory for type 'ManualObject' registered.
21:47:28: MovableObjectFactory for type 'BillboardChain' registered.
21:47:28: MovableObjectFactory for type 'RibbonTrail' registered.
21:47:28: OGRE EXCEPTION(6:FileNotFoundException): 'plugins.cfg' file not found! in ConfigFile::load at ..\..\ogre\OgreMain\src\OgreConfigFile.cpp (line 83)
21:47:28: plugins.cfg not found, automatic plugin loading disabled.
21:47:28: *-*-* OGRE Initialising
21:47:28: *-*-* Version 1.7.4 (Cthugha)
21:47:28: Creating resource group General
21:47:28: Creating resource group Internal
21:47:28: Creating resource group Autodetect
21:47:28: SceneManagerFactory for type 'DefaultSceneManager' registered.
21:47:28: Registering ResourceManager for type Material
21:47:28: Registering ResourceManager for type Mesh
21:47:28: Registering ResourceManager for type Skeleton
21:47:28: MovableObjectFactory for type 'ParticleSystem' registered.
21:47:28: OverlayElementFactory for type Panel registered.
21:47:28: OverlayElementFactory for type BorderPanel registered.
21:47:28: OverlayElementFactory for type TextArea registered.
21:47:28: Registering ResourceManager for type Font
21:47:28: ArchiveFactory for archive type FileSystem registered.
21:47:28: ArchiveFactory for archive type Zip registered.
21:47:28: FreeImage version: 3.15.3
21:47:28: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
21:47:28: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,exr,j2k,j2c,jp2,pfm,pct,pict,pic,3fr,arw,bay,bmq,cap,cine,cr2,crw,cs1,dc2,dcr,drf,dsc,dng,erf,fff,ia,iiq,k25,kc2,kdc,mdc,mef,mos,mrw,nef,nrw,orf,pef,ptx,pxn,qtk,raf,raw,rdc,rw2,rwl,rwz,sr2,srf,srw,sti
21:47:28: Registering ResourceManager for type HighLevelGpuProgram
21:47:28: Registering ResourceManager for type Compositor
21:47:28: MovableObjectFactory for type 'Entity' registered.
21:47:28: MovableObjectFactory for type 'Light' registered.
21:47:28: MovableObjectFactory for type 'BillboardSet' registered.
21:47:28: MovableObjectFactory for type 'ManualObject' registered.
21:47:28: MovableObjectFactory for type 'BillboardChain' registered.
21:47:28: MovableObjectFactory for type 'RibbonTrail' registered.
21:47:28: *-*-* OGRE Initialising
21:47:28: *-*-* Version 1.7.4 (Cthugha)
21:47:28: Loading library RenderSystem_Direct3D9
21:47:28: Installing plugin: D3D9 RenderSystem
21:47:28: D3D9 : Direct3D9 Rendering Subsystem created.
21:47:28: D3D9: Driver Detection Starts
21:47:28: D3D9: Driver Detection Ends
21:47:28: Plugin successfully installed
21:47:28: Loading library RenderSystem_GL
21:47:28: Installing plugin: GL RenderSystem
21:47:28: OpenGL Rendering Subsystem created.
21:47:28: Plugin successfully installed
21:47:28: Loading library Plugin_OctreeSceneManager
21:47:28: Installing plugin: Octree & Terrain Scene Manager
21:47:28: Plugin successfully installed
21:47:29: Creating resource group
21:47:29: Added resource location 'Media/packs/OgreCore.zip' of type 'Zip' to resource group ''
21:47:29: Added resource location 'Media/Scripts' of type 'FileSystem' to resource group 'General'
21:47:29: Added resource location 'Media/SkyMap/skybox.zip' of type 'Zip' to resource group 'General'
21:47:29: D3D9 : RenderSystem Option: Full Screen = No
21:47:29: D3D9 : RenderSystem Option: Video Mode = 800 x 600 @ 32-bit colour
21:47:29: CPU Identifier & Features
21:47:29: -------------------------
21:47:29: * CPU ID: GenuineIntel: Intel(R) Core(TM) i7-3770K CPU @ 3.50GHz
21:47:29: * SSE: yes
21:47:29: * SSE2: yes
21:47:29: * SSE3: yes
21:47:29: * MMX: yes
21:47:29: * MMXEXT: yes
21:47:29: * 3DNOW: no
21:47:29: * 3DNOWEXT: no
21:47:29: * CMOV: yes
21:47:29: * TSC: yes
21:47:29: * FPU: yes
21:47:29: * PRO: yes
21:47:29: * HT: no
21:47:29: -------------------------
21:47:29: D3D9 : Subsystem Initialising
21:47:29: Registering ResourceManager for type Texture
21:47:29: Registering ResourceManager for type GpuProgram
21:47:29: D3D9RenderSystem::_createRenderWindow "Main Ogre Window", 800x600 windowed miscParams: FSAA=0 FSAAHint= colourDepth=32 gamma=false monitorIndex=0 useNVPerfHUD=false vsync=true vsyncInterval=1
21:47:29: D3D9 : Created D3D9 Rendering Window 'Main Ogre Window' : 800x600, 32bpp
21:47:29: D3D9: Vertex texture format supported - PF_L8
21:47:29: D3D9: Vertex texture format supported - PF_L16
21:47:29: D3D9: Vertex texture format supported - PF_A8
21:47:29: D3D9: Vertex texture format supported - PF_BYTE_LA
21:47:29: D3D9: Vertex texture format supported - PF_R5G6B5
21:47:29: D3D9: Vertex texture format supported - PF_B5G6R5
21:47:29: D3D9: Vertex texture format supported - PF_A4R4G4B4
21:47:29: D3D9: Vertex texture format supported - PF_A1R5G5B5
21:47:29: D3D9: Vertex texture format supported - PF_A8R8G8B8
21:47:29: D3D9: Vertex texture format supported - PF_A8B8G8R8
21:47:29: D3D9: Vertex texture format supported - PF_B8G8R8A8
21:47:29: D3D9: Vertex texture format supported - PF_A2B10G10R10
21:47:29: D3D9: Vertex texture format supported - PF_DXT1
21:47:29: D3D9: Vertex texture format supported - PF_DXT2
21:47:29: D3D9: Vertex texture format supported - PF_DXT3
21:47:29: D3D9: Vertex texture format supported - PF_DXT4
21:47:29: D3D9: Vertex texture format supported - PF_DXT5
21:47:29: D3D9: Vertex texture format supported - PF_FLOAT16_RGB
21:47:29: D3D9: Vertex texture format supported - PF_FLOAT16_RGBA
21:47:29: D3D9: Vertex texture format supported - PF_FLOAT32_RGB
21:47:29: D3D9: Vertex texture format supported - PF_FLOAT32_RGBA
21:47:29: D3D9: Vertex texture format supported - PF_X8R8G8B8
21:47:29: D3D9: Vertex texture format supported - PF_R8G8B8A8
21:47:29: D3D9: Vertex texture format supported - PF_DEPTH
21:47:29: D3D9: Vertex texture format supported - PF_SHORT_RGBA
21:47:29: D3D9: Vertex texture format supported - PF_FLOAT16_R
21:47:29: D3D9: Vertex texture format supported - PF_FLOAT32_R
21:47:29: D3D9: Vertex texture format supported - PF_SHORT_GR
21:47:29: D3D9: Vertex texture format supported - PF_FLOAT16_GR
21:47:29: D3D9: Vertex texture format supported - PF_FLOAT32_GR
21:47:29: D3D9: Vertex texture format supported - PF_SHORT_RGB
21:47:29: D3D9: Vertex texture format supported - PF_PVRTC_RGB2
21:47:29: D3D9: Vertex texture format supported - PF_PVRTC_RGBA2
21:47:29: D3D9: Vertex texture format supported - PF_PVRTC_RGB4
21:47:29: D3D9: Vertex texture format supported - PF_PVRTC_RGBA4
21:47:29: RenderSystem capabilities
21:47:29: -------------------------
21:47:29: RenderSystem Name: Direct3D9 Rendering Subsystem
21:47:29: GPU Vendor: unknown
21:47:29: Device Name: Monitor-1-Microsoft Basic Render Driver
21:47:29: Driver Version: 6.2.9200.16420
21:47:29: * Fixed function pipeline: yes
21:47:29: * Hardware generation of mipmaps: no
21:47:29: * Texture blending: yes
21:47:29: * Anisotropic texture filtering: yes
21:47:29: * Dot product texture operation: yes
21:47:29: * Cube mapping: yes
21:47:29: * Hardware stencil buffer: yes
21:47:29: - Stencil depth: 8
21:47:29: - Two sided stencil support: yes
21:47:29: - Wrap stencil values: yes
21:47:29: * Hardware vertex / index buffers: yes
21:47:29: * Vertex programs: yes
21:47:29: * Number of floating-point constants for vertex programs: 256
21:47:29: * Number of integer constants for vertex programs: 16
21:47:29: * Number of boolean constants for vertex programs: 16
21:47:29: * Fragment programs: yes
21:47:29: * Number of floating-point constants for fragment programs: 224
21:47:29: * Number of integer constants for fragment programs: 16
21:47:29: * Number of boolean constants for fragment programs: 16
21:47:29: * Geometry programs: no
21:47:29: * Number of floating-point constants for geometry programs: 14624
21:47:29: * Number of integer constants for geometry programs: 12342
21:47:29: * Number of boolean constants for geometry programs: 0
21:47:29: * Supported Shader Profiles: hlsl ps_1_1 ps_1_2 ps_1_3 ps_1_4 ps_2_0 ps_2_a ps_2_b ps_2_x ps_3_0 vs_1_1 vs_2_0 vs_2_a vs_2_x vs_3_0
21:47:29: * Texture Compression: yes
21:47:29: - DXT: yes
21:47:29: - VTC: no
21:47:29: - PVRTC: no
21:47:29: * Scissor Rectangle: yes
21:47:29: * Hardware Occlusion Query: yes
21:47:29: * User clip planes: yes
21:47:29: * VET_UBYTE4 vertex element type: yes
21:47:29: * Infinite far plane projection: yes
21:47:29: * Hardware render-to-texture: yes
21:47:29: * Floating point textures: yes
21:47:29: * Non-power-of-two textures: yes
21:47:29: * Volume textures: yes
21:47:29: * Multiple Render Targets: 4
21:47:29: - With different bit depths: yes
21:47:29: * Point Sprites: yes
21:47:29: * Extended point parameters: yes
21:47:29: * Max Point Size: 10
21:47:29: * Vertex texture fetch: yes
21:47:29: * Number of world matrices: 0
21:47:29: * Number of texture units: 8
21:47:29: * Stencil buffer depth: 8
21:47:29: * Number of vertex blend matrices: 0
21:47:29: - Max vertex textures: 4
21:47:29: - Vertex textures shared: no
21:47:29: * Render to Vertex Buffer : no
21:47:29: * DirectX per stage constants: yes
21:47:29: ***************************************
21:47:29: *** D3D9 : Subsystem Initialised OK ***
21:47:29: ***************************************
21:47:29: DefaultWorkQueue('Root') initialising on thread main.
21:47:29: Particle Renderer Type 'billboard' registered
21:47:29: SceneManagerFactory for type 'OctreeSceneManager' registered.
21:47:29: SceneManagerFactory for type 'TerrainSceneManager' registered.
21:47:29: Parsing scripts for resource group
21:47:29: Parsing script OgreCore.material
21:47:29: Parsing script OgreProfiler.material
21:47:29: Parsing script Ogre.fontdef
21:47:29: Parsing script OgreDebugPanel.overlay
21:47:29: Texture: New_Ogre_Border_Center.png: Loading 1 faces(PF_A8R8G8B8,256x128x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x128x1.
21:47:29: Texture: New_Ogre_Border.png: Loading 1 faces(PF_A8R8G8B8,256x256x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x256x1.
21:47:29: Texture: New_Ogre_Border_Break.png: Loading 1 faces(PF_A8R8G8B8,32x32x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,32x32x1.
21:47:29: Texture: ogretext.png: Loading 1 faces(PF_A8R8G8B8,256x128x1) with 5 generated mipmaps from Image. Internal format is PF_A8R8G8B8,256x128x1.
21:47:29: Parsing script OgreLoadingPanel.overlay
21:47:29: Finished parsing scripts for resource group
21:47:29: Parsing scripts for resource group Autodetect
21:47:29: Finished parsing scripts for resource group Autodetect
21:47:29: Parsing scripts for resource group General
21:47:29: Finished parsing scripts for resource group General
21:47:29: Parsing scripts for resource group Internal
21:47:29: Finished parsing scripts for resource group Internal
21:47:30: OGRE EXCEPTION(2:InvalidParametersException): Sky box material 'Examples/SpaceSkyBox' not found. in SceneManager::setSkyBox at ..\..\ogre\OgreMain\src\OgreSceneManager.cpp (line 1714)
I hope someone can point me out what I'm doing wrong.
Patrick