Easy Ogre Exporter for 3DSMAX

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

can you send me the max file with the bad model ? so I could figure it out
OpenSpace 3D Project manager
http://www.openspace3d.com
araccun
Kobold
Posts: 33
Joined: Mon Mar 10, 2014 6:37 pm

Re: Easy Ogre Exporter for 3DSMAX

Post by araccun »

I got problem with camera position export, i get .scene file with camera settings like this

Code: Select all

        </node>
        <node name="Camera" id="152" isTarget="false">
	     <position x="16.1082" y="1472" z="-6379.47" />
	     <rotation qx="-3.29317e-009" qy="-0.999048" qz="-0.0436194" qw="7.5426e-008" />
	     <scale x="1" y="1" z="1" />
             <camera name="Camera" id="153" fov="0.785398">
                <clipping near="0.0254" far="25.4" />
             </camera>
        </node>
And that dosent seem to work but when i move position attributes below

Code: Select all

        </node>
        <node name="Camera" id="152" isTarget="false">
            <camera name="Camera" id="153" fov="0.785398">
		<position x="16.1082" y="1472" z="-6379.47" />
		<rotation qx="-3.29317e-009" qy="-0.999048" qz="-0.0436194" qw="7.5426e-008" />
		<scale x="1" y="1" z="1" />
                <clipping near="0.0254" far="25.4" />
            </camera>
        </node>
Everything works well, any ideas?
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

the problem must be in your dot scene loader.
It seems logical to me to set the PRS on the camera node.

or do you mean the camera positions are on a wrong direction ?
OpenSpace 3D Project manager
http://www.openspace3d.com
araccun
Kobold
Posts: 33
Joined: Mon Mar 10, 2014 6:37 pm

Re: Easy Ogre Exporter for 3DSMAX

Post by araccun »

Everythings works fine, just camera postion, rotation etc isnt loaded correctly.
My DotSceneLoader.cpp file:
http://pastebin.com/gBRh9svP
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

the camera link on parent node is commented in your code
so it don't take the parent node position

//if(pParent)
// pParent->attachObject(pCamera);
OpenSpace 3D Project manager
http://www.openspace3d.com
weaklyinteractinwimp
Gnoblar
Posts: 6
Joined: Fri Mar 07, 2014 5:18 am

Re: Easy Ogre Exporter for 3DSMAX

Post by weaklyinteractinwimp »

Hi arkeon, sorry for the delay, but here is the .max file for the simple cuboid i alluded to - actually i've had to zip it up as the forum disallows the .max extension. I really appreciate your help and diligence in this matter.
Thanks in advance.
You do not have the required permissions to view the files attached to this post.
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

Hi,

this is a simple cube ?! and it fail to export ?

It works for me, but be careful your max units are in mm and your cude is 50mm wide
maybe that it is too small to see it in your viewer because of the camera near clip
OpenSpace 3D Project manager
http://www.openspace3d.com
weaklyinteractinwimp
Gnoblar
Posts: 6
Joined: Fri Mar 07, 2014 5:18 am

Re: Easy Ogre Exporter for 3DSMAX

Post by weaklyinteractinwimp »

Hi arkeon,
This one actually did export to Ogre format but i wasn't able to open it in Ogre, or even ogremeshy http://www.ogre3d.org/tikiwiki/Ogre+Meshy

I will try again with your suggestions, but please do try and convert the cuboid to Ogre .mesh and try opening/viewing it in Ogre/ogremeshy

Many thanks.
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

It works for me in ogre meshy ^^

do you have any special option checked in the exporter ? like LOD for example
OpenSpace 3D Project manager
http://www.openspace3d.com
araccun
Kobold
Posts: 33
Joined: Mon Mar 10, 2014 6:37 pm

Re: Easy Ogre Exporter for 3DSMAX

Post by araccun »

How i can export normal maps? I tried applying my normal, both tangent and object space to bump map slot, with normal map modifier and without.
My question is how i suppose assign materials to Standard material type, now its:
Diffuse map -> Diffuse Color
Specular map -> Specular Color
Gloss Map -> Glossiness
Normal Map -> Normal Bump -> Bump

Screen: http://imgur.com/shnQzWs

Shadows init:

Code: Select all

	m_pSceneMgr->setShadowCasterRenderBackFaces(false);
	m_pSceneMgr->setShadowTextureSize(8192);
	m_pSceneMgr->setShadowTechnique(Ogre::SHADOWTYPE_TEXTURE_ADDITIVE);
	m_pSceneMgr->setShadowCameraSetup(ShadowCameraSetupPtr(new DefaultShadowCameraSetup()));
	m_pSceneMgr->setShadowFarDistance(1700.0f);
	m_pSceneMgr->setShadowDirLightTextureOffset(0.75f);
Im using Directional Light that cast shadows and seperate light for diff

And generated material:

Code: Select all

material "Ground_mat"
{
	technique Ground_mat_technique
	{
		pass Ground_mat_Ambient
		{
			ambient 1 1 1 1
			diffuse 1 1 1 1
			specular 0.18 0.18 0.18 0.2 22.95
			emissive 0 0 0 1

			illumination_stage ambient
			vertex_program_ref vsAmbGEN0
			{
			}
			fragment_program_ref fpAmbGENDIFF0
			{
			}

			texture_unit Ground_mat_Diffuse#0
			{
				texture ground_dDo_d.jpg
				tex_coord_set 0
				mipmap_bias -1
				colour_op modulate
			}
		}
		pass Ground_mat_Light
		{
			ambient 1 1 1 1
			diffuse 1 1 1 1
			specular 0.18 0.18 0.18 0.2 22.95
			emissive 0 0 0 1

			scene_blend add

			iteration once_per_light

			illumination_stage per_light
			depth_write off
			vertex_program_ref vsLightGENNORM0
			{
			}
			fragment_program_ref fpLightGENDIFF0NORM0
			{
				param_named normalMul float 0.3
			}

			texture_unit Ground_mat_Diffuse#1
			{
				texture ground_dDo_d.jpg
				tex_coord_set 0
				mipmap_bias -1
				colour_op modulate
			}

			texture_unit Ground_mat_Normal#2
			{
				texture ground_dDo_n.jpg
				tex_coord_set 0
				mipmap_bias -1
				colour_op modulate
			}
		}
	}
	technique Ground_mat_basic_technique
	{
	scheme basic_mat
		pass Ground_mat_standard
		{
			ambient 1 1 1 1
			diffuse 1 1 1 1
			specular 0.18 0.18 0.18 0.2 22.95
			emissive 0 0 0 1

			texture_unit Ground_mat_Diffuse#3
			{
				texture ground_dDo_d.jpg
				tex_coord_set 0
				colour_op modulate
			}
		}
	}
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

standard material export :
- Ambient texture channel
- Diffuse texture channel
- Specular Color texture channel
- Self illumination texture channel
- Bump channel with or without normal map texture type (but the bitmap should be a normal map only)
- Reflection channel (use a cube map for better results)

Other channels are ignored.

The texture amount value is also exported, so to get a normal map with 100% of the values you should set the Bump amount to 100 (max set it to 30 by default)

Textures can be Bitmap type, Normal map (for bump channel only) and animated IFL textures.


you material seems ok (but specular and gloss are ignored, put the specular texture in specular color channel instead)
your normal value is 30 in max 'param_named normalMul float 0.3" try to set it to 100.

Normals on you object can also be bad, make a reset xform on the object to reset it, maybe that some faces are inverted.
OpenSpace 3D Project manager
http://www.openspace3d.com
User avatar
JJJohan
Gnoblar
Posts: 14
Joined: Tue Nov 11, 2008 1:02 pm
Location: Brisbane, Australia

Re: Easy Ogre Exporter for 3DSMAX

Post by JJJohan »

Hi arkeon, thanks for the wonderful plugin. I'm currently trying to utilize it to perform exporting of thousands of meshes for a particular work project, and while it works great I find that because there are around 50,000 nodes in the 3DS Max file the export is primarily slowed down by the logging. I've been trying to solve the process myself but have found that with 3DS Max 2015 and the latest Ogre 1.9 there are particular files missing, (animation related which I don't need). However commenting these out I'm stuck with two results:

- The DLE won't load, it claims a module isn't found.
- The DLE loads but crashes when I hit the actual export button.

I don't imagine you would have a 2015 edition of Max at hand, but if you could perhaps build a 2014 version with logging disabled it would be greatly appreciated.
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

Hi
I should get a 2015 SDK soon to update the plugin.
Adding a checkbox in the interface to disable the log could be a good idea, I'll see that
OpenSpace 3D Project manager
http://www.openspace3d.com
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

On 2015 SDK they change again the Visual version to 2012
So until I could rebuild everything to VS 2012 the moprher crash again (this is the only special linked plugin lib from max and I'm not able to compile it with 2010)
So I have to recompile every dependencies and I'm not sure that they will compatible with older versions...

Any idea ?
OpenSpace 3D Project manager
http://www.openspace3d.com
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

EOE 2.0 available

- Now support Max 2015
- Added an option to disable logs on export

I Kept VS 2010 for versions previous to 2015

To build this version you have to use VS 2012 and keep the "100" toolset version for previous plugins versions.
For 2015 version build all dependencies with VS 2012
OpenSpace 3D Project manager
http://www.openspace3d.com
araccun
Kobold
Posts: 33
Joined: Mon Mar 10, 2014 6:37 pm

Re: Easy Ogre Exporter for 3DSMAX

Post by araccun »

How i can make my app work with exported materials? I got default 1.9 sdk and i cant make it work with normal maps etc do i need some shaders? Please help i trying to make it work for like week and still nothing. Do i need remove all other resources with shaders from resources, it is possible for conflicts??
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

Hi !

by default EOE exporter create separated directories for resources to get clean resources paths. (meshes, textures, materials, programs)
but you need to add this separated directories in Ogre to allow it to find the resources.

also you can simply try to remove each resource directories in the exporter parameters, so all the files will be exported in the same directory.
And it should be easier for you to manage them.

For normal maps the export generate shaders itself, so you just have to load them in ogre resources.
OpenSpace 3D Project manager
http://www.openspace3d.com
araccun
Kobold
Posts: 33
Joined: Mon Mar 10, 2014 6:37 pm

Re: Easy Ogre Exporter for 3DSMAX

Post by araccun »

Thanks for responding again! I did i added every single sub folder to resource file additional i commented default ones(i think that was my mistake earlier) and i think i got my resources file done. Do i need RenderSystem_GL plugin and CgProgramManager plugin? The last suspect can be setup of my lights i got texure shadows with 1 directional light that drops shadows and sunLight with these settings:

Code: Select all

	// SunLight
	Ogre::Light *sunLight = m_pSceneMgr->createLight("SunLight");
	sunLight->setDiffuseColour(0.35f, 0.35f, 0.38f);
	sunLight->setSpecularColour(0.9f, 0.9f, 1.0f);
	sunLight->setCastShadows(false);
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

Shaders are exported in CG language, so yes you should need the CgProgramManager plugin.
These shaders works in DirectX and OpenGL

I don't know about your shadow system ^^ generally texture shadows need a custom pass in material and shaders.
OpenSpace 3D Project manager
http://www.openspace3d.com
araccun
Kobold
Posts: 33
Joined: Mon Mar 10, 2014 6:37 pm

Re: Easy Ogre Exporter for 3DSMAX

Post by araccun »

Oops...
Image
I was testing all the time materials with my Ground mesh, looks like my problem was only present on this specific mesh and for every other mesh eveything was ok, screen shot below:
http://i.imgur.com/iFwtcVe.jpg
So normal maps was fine all the time, but your material dosent seem to work for my Ground entity, need to inspect that but i think is connected with Hydrax.

@EDIT That was my ground mesh everything is fine now Thanks again arkeon! You helped me a lot! And i fixed thing that was bothering me for a week and i can start making progress again
Last edited by araccun on Tue Apr 08, 2014 12:29 am, edited 1 time in total.
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

good :)
OpenSpace 3D Project manager
http://www.openspace3d.com
araccun
Kobold
Posts: 33
Joined: Mon Mar 10, 2014 6:37 pm

Re: Easy Ogre Exporter for 3DSMAX

Post by araccun »

Ok i found problem, thats all about disabling shadow casting on mesh, if you disable them you cannot use other maps like spec or normal. Additionaly i want to mention that you must disable shadow casting on ground mesh while using SHADOWTYPE_TEXTURE to make shadows visible on it. Do you know any solution or this is Ogre engine problem?
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

Correctly manage texture shadows mean that you should add a shadows caster and receiver pass in the scene materials.
Look at the ogre shadows demo for integrated shadow texture. By default ogre apply shadow textures on standard materials but those with shaders need special shadow management in the material and shaders.
You could find more info about that in other forum topics.
OpenSpace 3D Project manager
http://www.openspace3d.com
User avatar
JJJohan
Gnoblar
Posts: 14
Joined: Tue Nov 11, 2008 1:02 pm
Location: Brisbane, Australia

Re: Easy Ogre Exporter for 3DSMAX

Post by JJJohan »

Hi arkeon, I'm really struggling to get a compiled 3DS Max plugin from the source. First I've had to find a source version of NVTT, I ended up just taking it out as I won't be using DDS. Then I ended up having issues getting OgreProgressiveMeshGenerator.h which I've sort of sticky-taped together, although I end up with a DLE that loads, but crashes when an actual export happens.

Is there any chance you'd be able to zip up a ready-to-go source version of the plugin? The 2015 precompiled DLE works great, but I'd like to make some small changes that are specific to a project I'm working on.
arkeon
Goblin
Posts: 272
Joined: Fri Dec 04, 2009 6:02 pm
x 38

Re: Easy Ogre Exporter for 3DSMAX

Post by arkeon »

Hi !

sorry I can't distrib max sdks ^^

if your crash depend of the morpher export, you need to build it from the max samples and use it in the libs.
Otherwise it must be one of your change that crash, you can debug using the hybrid mode, look in the readme file for details
OpenSpace 3D Project manager
http://www.openspace3d.com