Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Tue Oct 17, 2017 6:25 pm

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Problem with normals
PostPosted: Sat Aug 04, 2007 11:53 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
I have the next object:
http://vicentecarro.dyndns.org/bugs/torre.tar.bz2

The normals are well aligned according Blender (even I have tested to import the tri mesh to assure the normals are right, and they are), I have checked and rechecked once and another time and so... But they are still shown ugly(maybe normal inverted) when view from raydium.
Image

What's happening?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 06, 2007 7:54 pm 
Offline

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759
Hello,

Your model seem's ok for normals,
but not for vertices;

Try to remove duplicate vertices:

edit mode, select all
vertices -> removes dupes.

Here i can remove up to 47 vertices on 72.

Try this and hope ;o)

Bye
Ouille


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 06, 2007 9:58 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
I have removed the vertices but i didn't help. Eve more, the exporter re-generates the removed vertices. If you try to export the rem-double-mesh you can see the resulting image has 70+(not sure how many) lines.

Also i have tried to remove the UV coords and restart the UV process, but no luck.

Really, i don't know what's happening with this file...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 07, 2007 1:30 pm 
Offline

Joined: Sun Oct 09, 2005 10:46 pm
Posts: 759
Hello,

For vertices you're right.

It seem that your texture have problem.

When i replace your texture by one other from maniadrive for example. Render is correct.


It seems that your texture is transparent or something like this.

Open your model with blender.
And save your tga file in tga raw format under the uv image editor.

Here it work :) ! But don't ask me why :(

have a nice day.
Ouille


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 07, 2007 3:17 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
I'll do a test ASAP.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 07, 2007 9:15 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
Hi guys,

Nice spot from ouille, this is probably a trouble about the texture format. See the console about the loading of this texture, it's probably a blended texture.

After a very quick look to the Raydium doc, we may have a small gap in this doc about texture types. A texture may be :

- standard ("3 Bpp b0" in the console) : no blend at all
- alpha only ("1 Bpp b1"), like smoke, fonts, ...
- alpha blended (" 4 Bpp b1"), as logo6.tga or the Clio's windscreen for example (and probably your texture)

The problem is that blended textures (b1) can't be rendered like others, because of ZBuffer concept. It may work for car windows for example, but not for a tower, as you see ;)

So Raydium provides sort of a compromise, with "cutout" textures (b2), where pixels are 100% transparent of 0% transparent.

So for you vicente, two solutions :
1) Your texture does not need to be blended, so remove the alpha layer (in gimp: "flatten image" in Layers [CTRL+L], for example) so your texture can be only 3 bit per pixel (3Bpp in the console), as almost all other textures.

2) Your texture need to have some "holes", so you must have an alpha layer (it's always a better idea to create holes in the 3D model in this case, but not always possible). Then you must be very carefull to have only 0% or 100% opacity for every pixel. (gimp: Layer -> Transparency -> Threshold Alpha)

Hope that helps ! (We may update the doc, if so ;) )


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 08, 2007 9:20 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
Hmm, interesting, i'll do a test.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 08, 2007 10:38 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
Ok, fixed, that was the problem.
I have seen a lot of games(but not in all them) this "lack" of transparent textures. I always though that behaviour was intentional, to save graphic power.
In raydium is for save power or is related to another issue?

If needed, i could use alpha transparent textures with more than 1bit in the alpha channel with some kind of trick?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 08, 2007 2:16 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2590
Location: gnniiiii (Scrat)
Graphics card use zbuffers. As you probably know, the idea of the zbuffer is to store the z-depth of a fragment (=pixel in the color buffer of the card) so when a new fragment comes at the same place later, you can quickly see if you will erase the last fragment with the new one or not, depending on its own z-depth.

So then, you can see the trouble with blended textures : if these textures writes to the zbuffer, nothing can be "behind", then. And that's wrong, since there's, for exampe, a lot of things "behind" (with deeper z values, to be accurate) the Clio windows. But if these textures don't write to the zbuffer, anything rendered later will erase the blended fragment, so the user will see this new pixel in front of the old one, even if the new one is supposed to be behind.

Raydium use a small trick then: it renders all blended textures (b1) at the end of the rendering only (warning ! this is a "per object" behavior !), so most of the time you can work with blended textures without too much troubles. But there a few problems then : blended textures will figth each others when they overlaps :) And that the case with your tower. That's also the case with cars windows, but since (unlike your tower) it's real semi-transparent textures, it's quiet hard to see it.

Here is a shot showing this effect in ManiaDrive:
Image

There's no other trick than that : use 8 bits alpha blended textures only when it's really needed (for semi-transparent things) and try to avoid overlaps.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group