exporting alpha into m3g

Forum for discussion on 3D games for mobile platform and doubts related to M3G, Mascot capsule and other rendering engines.

exporting alpha into m3g

Postby ladty » Wed Jul 09, 2008 11:28 am

Hello,
Please, could somebody tell me if there is any possibility to export object with alpha maps into m3g file from 3ds max?
Thanks for reply....
Ladty
User avatar
ladty
 
Posts: 24
Joined: Wed Jul 09, 2008 10:36 am
Location: Czech republic

Re: exporting alpha into m3g

Postby DevelopmentTeam » Wed Jul 09, 2008 12:14 pm

If you mean alpha map to produce a terrain with an alpha map, I dont think there is a prebuilt function that can load alpha image and build your terrain. Previously, in our game Alpine Skier 3D we tried using such techniques, but finally ended up using many m3g files and fuse it show the complete terrains. I dont exactly remember why we dropped that idea, but we had to code it ourself to create terrain pixel by pixel and it was very slow.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Re: exporting alpha into m3g

Postby ladty » Wed Jul 09, 2008 5:58 pm

I'm not sure we understood each other. You mean this? I'm not so good in english so I'm sorry if you don't understand me well (or I do not). I want to export some object (mesh), which would have transparent places in polygons depending on its texture. Here I uploaded what do I mean - the plane in the middle is a polygon (2 triangles) with transparent texture. But the transparency in the grid is done by coding, when I "put" the same texture on that plane in max and export it, it's not transparent but white. (it looks like when I'm using "Image2D.RGB" instead of "Image2D.RGBA" in the code). So it's possible to achieve the transparency by coding, but to be honest I think it's unnecessarily complicated. So I'd like to do this already within "max to m3g" export. Do you know what do I mean and if so, do you know how to do that? Thanks very much :-)
User avatar
ladty
 
Posts: 24
Joined: Wed Jul 09, 2008 10:36 am
Location: Czech republic

Re: exporting alpha into m3g

Postby DevelopmentTeam » Thu Jul 10, 2008 4:59 am

And yes you got what I meant. And thanks for the link, however it might help us in future developments with height maps.

Now coming to your point, I understand that you are trying to bring transparency on the terrain and this is something that we tried in the game for fence on both sides, but we were not happy enough to bring transparency in m3g. The problem occurs when you export the terrain into m3g file. The file doesnt support transparency. We even tried single color transparent PNG and that didnt work on few devices we tested.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Re: exporting alpha into m3g

Postby DevelopmentTeam » Thu Jul 10, 2008 5:07 am

meanwhile, if you can check with this function to apply transparency on texture2d object. "setBlendColor"
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Re: exporting alpha into m3g

Postby ladty » Thu Jul 10, 2008 2:50 pm

So the *.m3g filetype doesn't support transparency at all? Bad luck :-( But thanks, that's what I wanted to know :-) I'll try the "setBlendColor" function, I hope it'll work :wink:
User avatar
ladty
 
Posts: 24
Joined: Wed Jul 09, 2008 10:36 am
Location: Czech republic

Re: exporting alpha into m3g

Postby DevelopmentTeam » Fri Jul 11, 2008 4:53 am

It doesn't support alpha transparency, but we were not able to try setBlendColor that time. You can check with that and it works with single color transparency.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Re: exporting alpha into m3g

Postby ladty » Fri Jul 11, 2008 10:59 pm

Sorry, I probably don't understand you well... How can help me, if I "setblendColor" to Texture2D? That won't change anythink, or what else should I do? :(
User avatar
ladty
 
Posts: 24
Joined: Wed Jul 09, 2008 10:36 am
Location: Czech republic

Re: exporting alpha into m3g

Postby DevelopmentTeam » Sat Jul 12, 2008 3:32 am

I have not used it. But I think if you set a particular color, which you want to make transparent, the m3g engine will make the color transparent. So dont use transparency in the image. Put a specific color for the place where you want to make transparent and then set the color using the function setblendcolor to make that place transparent.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India

Re: exporting alpha into m3g

Postby ladty » Sat Jul 12, 2008 11:37 am

Yes, I understand you, but I don't know if jsr-184 can do that... I was experimenting with "setBlendColor" now and it's somethink else - you can try it yourself,it probably sets the color to which the texture "fades" (in "FUNC_BLEND" mode). I don't know how to do what mentioned :-(
User avatar
ladty
 
Posts: 24
Joined: Wed Jul 09, 2008 10:36 am
Location: Czech republic

Re: exporting alpha into m3g

Postby DevelopmentTeam » Sat Jul 12, 2008 2:13 pm

Ok, Then I dont have any other possible way to do that. If I come across some info I'll definitely post here.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India


Return to 3D Mobile Game (M3G)

Who is online

Users browsing this forum: No registered users and 1 guest

cron