How can I use render to texture with Ogre? (Solved)

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
User avatar
Hansel
Gremlin
Posts: 168
Joined: Mon Oct 24, 2005 6:01 pm

How can I use render to texture with Ogre? (Solved)

Post by Hansel »

Hi :D

I'm triying to use render to texture with Ogre to add a "complete map" to my mesh. I'm doing it with 3dsMax 8.

I follow the next steps:


- First I build a simple scene (a cube over a plane) with a simple texture on it and then I add a ligth.

Image



- Second I go to Rendering-> Render To Texture and I select in Render Settings "3dmax.scanline.radiosity.high", in Mapping Coordinates I turn the obtect channel to "1" and then I add a Complete Map Size = 2048. I push render button.


Image Image




- After pushing the button this is the result in the viewport:


Image


- And an Automatic Flaten UV is added to the scene.




But then I have the problem, because I don't know how to export it in Ogre. I try to add an UVW map with Vertex Color Channel turning on to let the texture coordinates as they was, I try to aply a new material in the scene using the complete_map.tga, I try to change the channels values and finally I try loading material directly in ogre with mesh->setMaterial, but unfortunatelly anything works :(


Anyone can help me? Thanks :D
Last edited by Hansel on Fri May 26, 2006 7:12 pm, edited 1 time in total.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

I see that you are running MAX - why not go to the oFusion Forum and see what it can do for you? :)

There's even a complete tutorial about how to do what you are trying to do. :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
Hansel
Gremlin
Posts: 168
Joined: Mon Oct 24, 2005 6:01 pm

Post by Hansel »

But I don't use ofusion, I use Ogre Exporter :wink:
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

So?
You can read the tutorial anyway?
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
Hansel
Gremlin
Posts: 168
Joined: Mon Oct 24, 2005 6:01 pm

Post by Hansel »

jacmoe wrote:So?
You can read the tutorial anyway?
Sorry, I thought It was only for using with ofusion :oops: Thanks :D
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

Even if you're not actively using oFusion, there's a lot of valuable MAX wisdom to gain from the oFusion community. :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
Hansel
Gremlin
Posts: 168
Joined: Mon Oct 24, 2005 6:01 pm

Post by Hansel »

I've found this tutorial http://ofusion.inocentric.com/tutorial4.html but it doesn't show me how to export lightmaps and shadow maps in order to launch in Ogre, just how to use them to export with ofusion :(
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

I think MAX is creating those files for you, am I right?
If that's the case, just grab them and apply them to your mesh through a material script. :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
Hansel
Gremlin
Posts: 168
Joined: Mon Oct 24, 2005 6:01 pm

Post by Hansel »

I try it before but then the problem is with the UVM map:

Image


I add a simple UVW map with the vertex color channel selected to leave the Automatic Flaten UV as it was but when I launch the mesh using this script:

Code: Select all


- In C++ -> plane->setMaterialName("rendertotexture");


material rendertotexture
{
    technique
    {
        pass
        {
            ambient 0.588235 0.588235 0.588235
            diffuse 0.588235 0.588235 0.588235
            specular 0.9 0.9 0.9 0.0
            emissive 0.0 0.0 0.0
            texture_unit
            {
                texture plane1000x1000.tga
            }
        }
    }
}

I get the result you can see in the screen :(
User avatar
Hansel
Gremlin
Posts: 168
Joined: Mon Oct 24, 2005 6:01 pm

Post by Hansel »

I've solved it changing render to texture map channel to "1" again, exporting mesh only with the Automatic Flatten UV and finnally launching it manually with setmaterialname :mrgreen:

Thanks for all, jacmoe :D



edit.-

Image


;)
Post Reply