OgreMeshViewer viewport capabilities

A place for users of OGRE to discuss ideas and experiences of utilitising OGRE in their games / demos / applications.
User avatar
litobyte
Halfling
Posts: 64
Joined: Mon Mar 28, 2005 7:03 pm
Location: Somewhere in Italy

OgreMeshViewer viewport capabilities

Post by litobyte »

Maybe this has been already asked, but I couldn't find searching the forum:

What kind of realtime shaders Ogre Mesh Viewer supports ?

Every kind ? Only static ? Only texture rotation/translation effects ?

I mean the OgreMeshViewer viewport, what can show ? Just a simple preview, or the effective preview of a realtime shader ?

I tried export some .rfx file from RenderMonkey 1.6 to OgreMeshViewer, and it loads them, but the more complex of them (the ones which requires a HLSL program to run) shows but static (I can't rotate the mesh).

If I press apply material, or validate material, the mesh changes, and I see an unproper shader (like if is just directx7) on the mesh, and finally I can rotate it.

Any thoughts ?


Note:
If I press validate material, and then Apply Material, the MeshViewer crashes badly, I paste the log:

Code: Select all

-----------------------------------
Details:
-----------------------------------
Error #: 4
Function: D3D9RenderSystem::setConfigOption
Description: D3D9 : RenderSystem Option: Vertex processing = HardwareOption named 'Vertex processing' does not exist.. 
File: \Projects\OgreCVS\Branches\Azathoth\ogrenew\RenderSystems\Direct3D9\src\OgreD3D9RenderSystem.cpp
Line: 298
Stack unwinding: D3D9RenderSystem::setConfigOption(..) <- <<beginning of stack>>
15:28:39: D3D9 : RenderSystem Option: Anti aliasing = Level 2
15:28:39: D3D9 : RenderSystem Option: Video Mode = 800 x 600 @ 32-bit colour
15:28:39: Creating resource group MeshViewerGroup
15:28:39: Initialising resource group MeshViewerGroup
15:28:39: Parsing scripts for resource group MeshViewerGroup
15:28:39: Finished parsing scripts for resource group MeshViewerGroup
15:28:39: D3D9 : Subsystem Initialising
15:28:39: ***************************************
15:28:39: *** D3D9 : Subsystem Initialised OK ***
15:28:39: ***************************************
15:28:39: ResourceBackgroundQueue - threading disabled
15:28:39: D3D9RenderSystem::createRenderWindow "View", 100x100 windowed  miscParams: externalWindowHandle=1311386 
15:28:39: D3D9 : Created D3D9 Rendering Window 'View' : 636x476, 32bpp
15:28:40: Registering ResourceManager for type Texture
15:28:40: Registering ResourceManager for type GpuProgram
15:28:40: RenderSystem capabilities
15:28:40: -------------------------
15:28:40:  * Hardware generation of mipmaps: yes
15:28:40:  * Texture blending: yes
15:28:40:  * Anisotropic texture filtering: yes
15:28:40:  * Dot product texture operation: yes
15:28:40:  * Cube mapping: yes
15:28:40:  * Hardware stencil buffer: yes
15:28:40:    - Stencil depth: 8
15:28:40:    - Two sided stencil support: yes
15:28:40:    - Wrap stencil values: yes
15:28:40:  * Hardware vertex / index buffers: yes
15:28:40:  * Vertex programs: yes
15:28:40:    - Max vertex program version: vs_2_0
15:28:40:  * Fragment programs: yes
15:28:40:    - Max fragment program version: ps_2_0
15:28:40:  * Texture Compression: yes
15:28:40:    - DXT: yes
15:28:40:    - VTC: no
15:28:40:  * Scissor Rectangle: yes
15:28:40:  * Hardware Occlusion Query: yes
15:28:40:  * User clip planes: yes
15:28:40:  * VET_UBYTE4 vertex element type: yes
15:28:40:  * Infinite far plane projection: yes
15:28:40:  * Hardware render-to-texture: yes
15:28:40:  * Floating point textures: no
15:28:40:  * Non-power-of-two textures: yes
15:28:40:  * Volume textures: yes
15:28:40: Particle Renderer Type 'billboard' registered
15:28:40: Creating viewport on target 'View', rendering from camera 'MainCamera', relative dimensions L: 0.00 T: 0.00 W: 1.00 H: 1.00 ZOrder: 0
15:28:40: Viewport for camera 'MainCamera', actual dimensions L: 0 T: 0 W: 636 H: 476
15:28:40: MeshViewer -> default num nip map set to 5
15:28:40: MeshViewer -> 32Bit textures : true
15:28:40: MeshViewer -> default animation interpolation mode set to : IM_SPLINE
15:28:40: MeshViewer -> default anisotropy level set to : 1
15:28:40: MeshViewer -> default texture filtering set to : 3
15:28:40: Destroying resource group MeshViewerGroup
15:28:40: Unloading resource group MeshViewerGroup
15:28:40: Finished unloading resource group MeshViewerGroup
15:28:40: Parsing material scripts
15:28:40: Creating resource group MeshViewerGroup
15:28:40: Added resource location 'C:\Documents and Settings\Administrator\Desktop\Blitz2Ogre\exportedmesh\ogre3d\turtle' of type 'FileSystem' to resource group 'MeshViewerGroup'
15:28:40: Initialising resource group MeshViewerGroup
15:28:40: Parsing scripts for resource group MeshViewerGroup
15:28:40: Parsing script Direct_X_9_Bubble_Effect.BubbleShader_ASM.Front_Faces.Pixel_Shader.program
15:28:40: Parsing script Direct_X_9_Bubble_Effect.BubbleShader_ASM.Front_Faces.Vertex_Shader.program
15:28:40: Parsing script BubbleShader_ASM.material
15:28:40: Error in material Direct_X_9_Bubble_Effect.BubbleShader_ASM at line 54 of BubbleShader_ASM.material: Invalid param_indexed_auto attribute - time_0_x
15:28:40: Error in material Direct_X_9_Bubble_Effect.BubbleShader_ASM at line 121 of BubbleShader_ASM.material: Invalid param_indexed_auto attribute - time_0_x
15:28:40: Finished parsing scripts for resource group MeshViewerGroup
15:28:40: End of material scripts parsing.
15:28:40: Mesh: Loading turtle.mesh.
15:28:40: Texture: rainbowfilm_smooth.bmp: Loading 1 faces(PF_R8G8B8,256x256x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,256x256x1.
15:28:40: D3D9 : Loading Cube Texture, base image name : 'room-dxt5.dds' with 5 mip map levels
15:28:40: MaterialSerializer : writing material Direct_X_9_Bubble_Effect.BubbleShader_ASM to queue.
15:28:40: MaterialSerializer : parsing texture layer.
15:28:40: MaterialSerializer : parsing texture layer.
15:28:40: MaterialSerializer : done.
15:28:40: MaterialSerializer : parsing texture layer.
15:28:40: MaterialSerializer : parsing texture layer.
15:28:40: MaterialSerializer : done.
15:28:40: Texture: spot_shadow_fade.png: Loading 1 faces(PF_B8G8R8,128x128x1) with 5 generated mipmaps from Image. Internal format is PF_X8R8G8B8,128x128x1.
15:28:46: Material validation : START
15:28:46: Material validation : END
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66

Post by sinbad »

Material validation has been fixed in CVS. In theory all the materials OGRE supports can be rendered in the meshviewer - however if a shader does not use the model matrix then you won't be able to rotate it.
User avatar
litobyte
Halfling
Posts: 64
Joined: Mon Mar 28, 2005 7:03 pm
Location: Somewhere in Italy

Post by litobyte »

Also the shader was not "animating".

In comparison to the RenderMonkey1.6 viewport which shows a Tourus knot with that shader, which it shows it animated/morphed, the ogre3D preview of the same material applied on another mesh is "static", not morphing.

Should I paste the .material, vertex and pixel programs and mesh.xml source ?
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66

Post by sinbad »

Try them in an OGRE test app first. The meshviewer is a community contribution, we don't officially support it or maintain it and it may not render things exactly as a full OGRE app will.
User avatar
litobyte
Halfling
Posts: 64
Joined: Mon Mar 28, 2005 7:03 pm
Location: Somewhere in Italy

Post by litobyte »

Oh I c! :)

Infact I could render with shaders the models I exported with my tool, eg: the cellshading sample was rendering a model I exported correctly.

Thanks!
User avatar
litobyte
Halfling
Posts: 64
Joined: Mon Mar 28, 2005 7:03 pm
Location: Somewhere in Italy

Post by litobyte »

Hi back Sinbad,
in an OGRE test app first
Do you mean to load up the questioned mesh in any of the SDK samples ?

I tried with the cellshading sample project

I'm trying to make work any of the RenderMonkey 1.6 shaders with some mesh but I couldnt :(

I also tried loading it up in the place of the Ogre Head in the fresnel demo, I could load into it my lightmapped level (an export from .b3d) together with the water, fishes and all, but the "hlsl shaded" mesh was all black, and sometime disappearing from screen.

I only succeded in have the cellshading on any mesh I like, but that's a originary Ogre shader.
however if a shader does not use the model matrix then you won't be able to rotate it.
Infact that's right, and I solved specifying in RenderMonkey 1.6 the exact same model I will later export to .mesh, so now I can rotate it, but still...the shader is correct but not "alive" (trying the bubble one) and if I Validate or Apply the material script in the meshviewer the shader becomes in a snap a simple blending so no more a dx9 shader but the pure mesh but alpha blended.

I will post some screenshot to explain better if you like.