Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Thu Mar 28, 2024 8:09 pm

All times are UTC




Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Open Gl light
PostPosted: Sun Oct 12, 2008 4:43 pm 
Offline

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

Moddling scene with blender, exhibit a strange lighting when imported in raydium:

Image

As you can see it's a flat face (the door of my office), The wall between the two dors is flat but moddled with several triangles.

Light is strange, is there a way to avoid this ?

Here is blender scene before export:
Image

Help or seggestions welcomes.

Have a nice day.
Ouille.


Top
 Profile  
 
 Post subject: Re: Open Gl light
PostPosted: Sun Oct 12, 2008 6:50 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
Can you send the blend to making test?
update: I have found this:
Quote:
Question: Why doesn't the lighting in my scene show up properly on the walls and flat surfaces?

Answer: OpenGL performs lighting calculations on a per vertex basis, therefore, if you have a large flat surface, you will have to subdivide it so that OpenGL can actually calculate proper lighting.

So solutions: subdivide or using an alternative lighting system


Top
 Profile  
 
 Post subject: Re: Open Gl light
PostPosted: Mon Oct 13, 2008 6:41 am 
Offline

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

It seem to be the clue. I'll try to look with ambiant lighting.

Thank you.

Have a nice day.
Ouille


Top
 Profile  
 
 Post subject: Re: Open Gl light
PostPosted: Mon Oct 13, 2008 7:41 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
Ok.
Just for your information there is a group of raydium users hoping that raydium supports Deferred Rendering (that would solve all GL issues about rendering) as one alternative:
  • http://en.wikipedia.org/wiki/Deferred_shading
  • http://developer.nvidia.com/object/6800_leagues_deferred_shading.html (quite interesting)
You can talk with Martin_hex (or myself) in the chat about, if interested.


Top
 Profile  
 
 Post subject: Re: Open Gl light
PostPosted: Mon Oct 13, 2008 8:21 am 
Offline

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

It's really interresting, but far far away from my range of competance !

Have a nice day
Ouille


Top
 Profile  
 
 Post subject: Re: Open Gl light
PostPosted: Mon Oct 13, 2008 7:08 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
First, your normals are smoothed (so it also means it's shared between contiguous faces). If you want sharp edge and lighting, avoid "smooth groups". (F9 in raydium_modler will do the trick, for instance)

The other thing is that GL lights are not very suitable for indoor lighting. If you don't care about static lighting, the easy solution for you is to simply create a (radiosity) lightmap !

It allow you to transform this ...
Image
... to this ...
Image

For this, you can use FsRadRay, but Blender is now able to produce radiosity lightmaps by itself.


Top
 Profile  
 
 Post subject: Re: Open Gl light
PostPosted: Mon Oct 13, 2008 7:19 pm 
Offline

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

Quote:
First, your normals are smoothed (so it also means it's shared between contiguous faces)

Did i do that myself ? when ? How can you see this ?
My normals are extracted from my tri file (right ?)
Does blender have smooth them (when i draw the normals in blender they don't seem to be smoothed).

Quote:
F9 in raydium_modler


I never used it, but i'll have a look.

Light on your first screenshoot seems correct (desk is "well" lighted).

I remember what you write about fsrad. But it seems that it need lot's of tunning and long computing time.

Do you have an idea where to look in blender ?

If you have 5 min. to detail that deeper ..., else i'll try raydium_modler

Have a nice day.
Ouille


Top
 Profile  
 
 Post subject: Re: Open Gl light
PostPosted: Mon Oct 13, 2008 7:38 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
About normals : Blender seems to smooth automatically since a particular version. I see an "autosmooth" button in the mesh tools, you may have a look.

About raydium modler:
- launch it
- open the console
- /load model.tri
- F9
- /save model.tri

FSRadRay is not so complicated (computations are very simple) but it's probably more interesting, in a long term, to understand how lightmaps works in Blender. Unfortunately, I've only tested with a ready-to-use demo from the Blender website. We must find a nice tutorial !

But again, FsRadRay can produce nice things ;)


Top
 Profile  
 
 Post subject: Re: Open Gl light
PostPosted: Wed Oct 15, 2008 8:10 pm 
Offline

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

Raydium_modler is doing the trick fine !!!!
Is there a way to do this directly from blender ?

Image.

I manage to make radiosity baking from blender (i'll explain it soon).

Thank's for the info.

Have a nice day
Ouille


Top
 Profile  
 
 Post subject: Re: Open Gl light
PostPosted: Wed Oct 15, 2008 8:52 pm 
Offline

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

To manage to have sharp normal with blender, each face need to have his own vertices.
So each face need to be separate from other. Each face need to have her 3 vertices not shared with other faces.

This can be done by splitting (split) each face. Vertices count will grow up.

Removing vertices double will do oposite work.

So raydium_modler is my friend !

Have a nice day.

Ouille.


Top
 Profile  
 
 Post subject: Re: Open Gl light
PostPosted: Thu Oct 16, 2008 6:23 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Interesting tip, but I'm quiet sure there another way to do sharp edges with Blender. The behavior changed "one day", at a particular version, I supposed it's more a default value change. Or a "bug" in our exporter. Or I'm completely wrong.


Top
 Profile  
 
 Post subject: Re: Open Gl light
PostPosted: Thu Oct 16, 2008 6:52 pm 
Offline

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

After looking deep inside this appera:

If a vertex is shared by several faces: vertex normal is averaged by blender from face normals. And it's normal.

To have good lighting,each face need to have his vertex normal and faces normal colinear.

One vertex can have only one normal, thus it can't be normal to several faces (if it is shared between them).

I try solid and smooth but they don't change anything.

An other way to have good normal is to reimport exported tri. This time as exported explicit difine each vertice for each face, each face have his own vertice and good lighting.

If your remenber the command i can try to have a look to change log or something else but ...

Perhaps we have to handle solid and smooth parameter at export time. How are they handled by the mesh ?

Have a nice day
Ouille


Top
 Profile  
 
 Post subject: Re: Open Gl light
PostPosted: Thu Oct 16, 2008 7:43 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
I searched a bit, and only found old version of triEXP that does not export normals ... So maybe* my memory is faulty, and the change was in our exporter and not in Blender :)

So, to get back to the smooth/sharp option in export script, it's quiet easy to do, since we just have to switch back to TRI format version 0. But it's also quiet easy to do the "unsmooth" in the raydium_modler :) (maybe need to add this somewhere in the doc)

*: read "probably",


Top
 Profile  
 
 Post subject: Re: Open Gl light
PostPosted: Thu Oct 16, 2008 9:24 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
There is a blender script that, more or less, do the trick.
Open blender, select the object. Then go to edit mode.
Select all vertices. In the 3D viewport, open the Mesh menu, Scripts, Unweld Vertices.
Choose Unbind Points.
Sadly this script don't works fine. And you will have to repeat the process a lot of times to get it fully sucessful.


Top
 Profile  
 
 Post subject: Re: Open Gl light
PostPosted: Thu Oct 16, 2008 10:10 pm 
Offline

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

I'll try it, thank you.

An other question:

I manage to compute radiosity for my scene.

I can bake this radiosity to a texture.

Radiosity is computed without texture info (or i don't know how i can do that).

To have good render i need to multiply my radiosity texture with my "usual" face texture.

Is raydium able to do that ? Is it that multitexturing ?

If not what is multitexturing ?

Have a nice day.
Ouille


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 10 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