Raydium 3D Game Engine
https://memak.raydium.org/

Problem with normals
https://memak.raydium.org/viewtopic.php?f=8&t=683
Page 1 of 1

Author:  vicentecarro [ Sat Aug 04, 2007 11:53 am ]
Post subject:  Problem with normals

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?

Author:  ouille [ Mon Aug 06, 2007 7:54 pm ]
Post subject: 

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

Author:  vicentecarro [ Mon Aug 06, 2007 9:58 pm ]
Post subject: 

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...

Author:  ouille [ Tue Aug 07, 2007 1:30 pm ]
Post subject: 

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

Author:  vicentecarro [ Tue Aug 07, 2007 3:17 pm ]
Post subject: 

I'll do a test ASAP.

Author:  Xfennec [ Tue Aug 07, 2007 9:15 pm ]
Post subject: 

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 ;) )

Author:  vicentecarro [ Wed Aug 08, 2007 9:20 am ]
Post subject: 

Hmm, interesting, i'll do a test.

Author:  vicentecarro [ Wed Aug 08, 2007 10:38 am ]
Post subject: 

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?

Author:  Xfennec [ Wed Aug 08, 2007 2:16 pm ]
Post subject: 

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.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/