2 UV maps on mesh - 1 with alpha? (warning! contains images)

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

I think you should checkout http://irrlicht.spintz.com/. I added a function -

Code: Select all

virtual IMesh* createMeshWith2TCoords( IMesh* mesh ) const
which takes an IMesh* and returns a new IMesh with 2 texture coords per vertex.

I also modified makePlanarTextureMapping, to take an argument, so it can modify the 1st or 2nd texture coordinate of a mesh.

Code: Select all

virtual void makePlanarTextureMapping(scene::IMesh* mesh, bool firstTCoord, f32 resolution ) const
Check it out, let me know if you need any help getting it setup.

Here's an image of a frame of the Sydney model with a detail map texture, using 2 texture coords on the mesh -

Image
Image
Spintz
Posts: 1688
Joined: Thu Nov 04, 2004 3:25 pm

Post by Spintz »

Is this what you're trying to get?

Image

I used your code and it worked perfectly, your box is very small tho, you might want to scale it some, I think that's why you aren't seeing it!
Image
nixnerd
Posts: 14
Joined: Mon Jan 31, 2005 2:00 am
Location: United Kingdom

No, I'm trying to get this...

Post by nixnerd »

Hello Spintz,

Your improvments to Irrlich12 look very interesting, but I fear that as I know very little about C coding, it's not likely to help me at this stage.

This is what I'm aiming for, by combining the two textures onto one mesh.

Image

'luckymutt' suggested I make both textures have alpha, to see if one texture would fit over the top of the other, giving the effect in the picture above.

By-the-way, thanks for taking the time to download my code and textures to see what I'm trying to achieve, It's very kind of you :)
Spintz wrote:Is this what you're trying to get?

Image

I used your code and it worked perfectly, your box is very small tho, you might want to scale it some, I think that's why you aren't seeing it!
Guest

Post by Guest »

Hi Spintz, i have already tried to get your to compile. As I am just a 3D-folk and not a programmer i had some hard (for me) errors. But i guarantee, if you can get make it work with two textures (lightmaps, yeah) i will not rest until it compiles properly.

That would be something similar like christmas for me, but please dont feel urged.
winter

Post by winter »

This is perhaps a bad idea. But it may work. Make two cubes the same size with the same coords. Parent one to th other. Paint each cube with the each image.

It will probably work, but you'll have extra geometry that may slow down your app.

Just my two noobie centavos.
Post Reply