Raydium 3D Game Engine

Official forum for everything about Raydium, ManiaDrive, MeMak, ...
It is currently Thu Apr 25, 2024 4:38 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: fog commit
PostPosted: Mon Jun 19, 2006 8:13 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
As you can see i have commit a full revision of the fog functions.
But I have changed a bit the usual way of manage fog in opengl.

Now you have to change the properties with

void raydium_fog_mode_set(GLuint mode)
int raydium_fog_mode_get(void)
void raydium_fog_density_set(GLfloat density)
float raydium_fog_density_get(void)
void raydium_fog_near_set(GLfloat near)
float raydium_fog_near_get(void)
void raydium_fog_far_set(GLfloat far)
float raydium_fog_far_get(void)


But, you will have to use one of the next function to make effective the last changes. In fact , the above functions DO NOT CHANGE openGL stuff, just raydium internals. So the bottom functions are needed to apply the changes:

void raydium_fog_enable(void)
void raydium_fog_disable(void)
void raydium_fog_apply(void)
void raydium_fog_wait(void)


enable and disable are obvious.
raydium_fog_apply is the function that really applies the changes.
raydium_fog_wait is used to temporaly stop the use of fog withouf change the raydium internals about fog. The next tiem you use raydium_fog_apply, everything (should) returns to the previous state. Usefull for certain rendering operations (or i think so).

For example to see the real world use, you can edit mania_drive.c and let the end of the file like this:
Code:
raydium_fog_mode_set(RAYDIUM_FOG_MODE_LINEAR);
raydium_fog_color_update();
raydium_fog_near_set(0);
raydium_fog_far_set(10.0f);
//raydium_fog_density_set(0.15f);
raydium_fog_enable();

raydium_callback(&display);
return 0;
}


or, if you want to see exponential fog, you can try with this:

Code:
raydium_fog_mode_set(RAYDIUM_FOG_MODE_EXP2);
raydium_fog_color_update();
//raydium_fog_near_set(0);
//raydium_fog_far_set(10.0f);
raydium_fog_density_set(0.15f);
raydium_fog_enable();

raydium_callback(&display);
return 0;
}


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 19, 2006 8:23 pm 
Offline
User avatar

Joined: Sun Mar 16, 2003 2:53 am
Posts: 2591
Location: gnniiiii (Scrat)
It's all ok for me. Just a question, why using raydium_fog_color_update() in your examples ?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 19, 2006 8:50 pm 
Offline
User avatar

Joined: Thu Sep 29, 2005 2:59 pm
Posts: 828
hmm, it was an error (put the line)
But now i have noticed that there is a problem with the color of the fog.
Investigating...


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

All times are UTC


Who is online

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