Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Sun Apr 28, 2024 3:16 pm

All times are UTC




Post new topic Reply to topic  [ 51 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject:
PostPosted: Mon Oct 10, 2005 3:32 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
The idea is simple : keep the current context clean (restore every modified state) instead glPushAttrib/glPopAttirb, since it's way more easy to debug, and runs faster ! Each context modification may have a big impact on hardware, and things like switching the current texture is one of the slowest thing that may append on a 3D board, for example.

I do not use any IDE, but only "mcedit" (text editor from Midnight Commander) and command like scripts. I'll try to see how Anjuta handles tabs, since it's strange. For example, for something like :
Code:
toto = 10;

... I've seen ...
Code:
toto        =        10;

... in your code. Strange :) I must to be sure you know that I'm not blaming you, I just try to organize the whole thing :)

About texture/gradient, you can simply imagine 2 different functions (one for textured sphere, the other for gradient). The problem is more: how to provide a simple API that allows full gradient settings ("from" color, "to" color, with a "factor" for each [for example], rotation, rotation speed, ...) ... And this API must be extendable to your other good idea of multiple spheres :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 10, 2005 6:23 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
wops, the
Code:
toto        =        10;

is one of my "personal" manners, nothing about anjuta :P (the reason is that in that way is easier to read for my in large code)

Well, i'll keep imagining a good way for the gradients and so...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 12, 2005 9:08 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
I have a doubt. The counters are for humans or for programmers?, i mean, we start count on 0 or on 1?.
Code:
raydium_sky_atmosphere_layers_used(1);
raydium_sky_atmosphere_kind_layer(1,RAYDIUM_SKY_ATMOSPHERE_GRADIENT);
raydium_sky_atmosphere_gradients_layer(1,color1,color2);

This is the origin of the problem.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 12, 2005 10:46 am 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Raydium use almost always 0 as first index. There's some (few) cases where 0 means a particular thing so the first index is 1.
Short answer: prefer 0.

I've a small idea about the atmosphere thing ... what about something like that :
void raydium_sky_atmosphere_colors(... color_day, ... color_night);
void raydium_sky_atmosphere_hour_set(... hour, ... min);

... simple and powerful, no ?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 12, 2005 11:21 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
ok, sounds good, i'll implement it after i finish a few internal functions.
Right now setting colors for the gradients works fine.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 14, 2005 1:09 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
I have implemented almost the whole system of the skysphere but there is a problem.
When you, in the real world, look at the horizont, the clouds are visually more far than the clouds that are over you.
So the sphere shouldn't be spherical. :cry:
I have implemented a fix but, right now, the sphere nly should rotate around the vertical axis, in other way the effect can be quite ugly.
The new idea is that the sphere remains always inthe same position, but the texture will simulate the rotations.
Currently the system support gradients and textures and makes the blend effect correclty.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 14, 2005 3:33 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
and here the name of the functions, so you can say me if you want to change something before i commit it:

Code:
void raydium_sky_sphere_render(int layer, GLfloat x, GLfloat y, GLfloat z, int detail);
/**
Internal use.
Calculates and draw the sphere. Also rotate it according the angles or orbit.
**/

//Atmosphere
/**
Atmosphere are series of effects that intend to make the sky and the atmosphere
of the game more realistic. As this is quite-beta state, only a orbital sky
effect is available right now.
To activate/deactivate this series of effects, you should use:
##raydium_sky_atmosphere_enable## and ##raydium_sky_atmosphere_disable##
respectively.
If you need to check if the atmosphere is activated or not, use
##raydium_sky_atmosphere_check##. The rest of the functions are internal
and should not used by normal programs.
**/

void raydium_sky_atmosphere_enable(void);
/**
turn on the use of atmosphere effects.
This one and _disable function a program should use, the other
##raydium_sky_atmosphere_## are internal ones.
**/

void raydium_sky_atmosphere_disable(void);
/**
turn off the use of atmosphere effects.
**/

void raydium_sky_atmosphere_render(GLfloat x, GLfloat y, GLfloat z,int detail);
/**
Internal use. This internal function draws the atmosphere effects. Right
now only draws a rotating sphere with a gradient of color (from black to white).
In a future, it will draw multiples layers of sky (with and without textures),
stars, satellites... Maybe rain and snow could be included here also.
**/

signed char raydium_sky_atmosphere_check(void);
/**
This functions only check if the atmosphere features are been used.
Returns 1 if they are used, else 0.
**/

void raydium_sky_atmosphere_layers_used(int number);
/**
This functions set up the number of layers that the atmosphere will have.
Also all the previous configuration of atmosphere layers will be deleted.
**/

void raydium_sky_atmosphere_kind_layer(int layer, char unsigned kind);
/**
This function configures weather the layer ##layer## is a gradient or a texture one.
**/

void raydium_sky_atmosphere_gradients_layer(int layer, float color1[4],float color2[4]);
/**
With this function the colors of the gradient of the layer ##layer## can be set
to ##color1## and ##color2##
**/
void raydium_sky_atmosphere_orbits_layer(int layer, float orbit[3]);
/**
Function to set up the orbits for the layer ##layer##;
**/

void raydium_sky_atmosphere_texture_layer_name(int layer, char texture[255]);
/**
Function to set the texture of a layer, giving its name.
**/


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 14, 2005 9:13 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
About function names, It's good. I try to use "inverse notation" as much as possible, so:

raydium_sky_atmosphere_layer_kind() is probably "better" that raydium_sky_atmosphere_kind_layer() and so on. It's very close to a tree idea, like directories.

Another quick thing, avoid "char texture[255]" and prefer "char texture[RAYDIUM_MAX_NAME_LEN]".

... I'm curious to see the result of you work ! :)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 17, 2005 11:36 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
Ok, the old idea doen'st works properly so i'm working in a new idea.
The sky will be composed of "clouds" and "the rest". The clouds will be textures over a almost plain group of polygons over the camera. Could be more than 1 layer and the different layers will simulate its movement modifying the s-t coordinates of the application of the textures.
"The rest" will be as before. The moon, or other satellites can go here, as well as color gradients to "tint" the sky according the time of the day.

With this new system, the clouds will have a more realistic style than mapped into an sphere.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 18, 2005 7:03 am 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
Ok, sounds interesting :)
Another subject : I'll do a large commit soon, wich will impact every Raydium file (URL change in headers). It will probably raise a "conflict" with your files. Remember to "correct" this conflit (add my modification to your file(s)) while commiting.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 18, 2005 11:34 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
ok


Top
 Profile  
 
 Post subject:
PostPosted: Sat Nov 05, 2005 4:44 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
I'm working on shadow support, and I've tried "raydium_matrix_inverse" without any success. Have you try this code ?

It's working with this code :
http://ftp.cqfd-corp.org/mathlib.h
http://ftp.cqfd-corp.org/mathlib.c


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 06, 2005 10:49 am 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
here again :D
Well as i said you before, the math functions was "commited" by error, and no, they don't work properly.
Now, i will go step by step.
First, i'd like to finish the new skysphere effect. I have updated with the new SVN and i will dedicate the day to try finish it.
Else it will be finished for the party anyway.

After i should continue with the characters support, but the game that we are making need a few upgrades in raydium, so maybe i let the character support for another time. Anyway, when i finish the skyspehe i will decide.

Other question. With the tests of skysphere i'm using some art files. How can these be uploaded to the "repository"?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 06, 2005 5:09 pm 
Offline

Joined: Sun Mar 16, 2003 10:27 am
Posts: 404
use raydium_modler to upload art files to the repository.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Nov 06, 2005 7:23 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
raydium_modler? where is that?


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 195 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:  
Powered by phpBB® Forum Software © phpBB Group