00001 00002 /* 00003 TEDDY - General graphics application library 00004 Copyright (C) 1999-2002 Timo Suoranta 00005 tksuoran@cc.helsinki.fi 00006 00007 This library is free software; you can redistribute it and/or 00008 modify it under the terms of the GNU Lesser General Public 00009 License as published by the Free Software Foundation; either 00010 version 2.1 of the License, or (at your option) any later version. 00011 00012 This library is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public 00018 License along with this library; if not, write to the Free Software 00019 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 00021 $Id: LWSceneEffects.cpp,v 1.1 2002/02/16 12:41:39 tksuoran Exp $ 00022 */ 00023 00024 00025 #include "Teddy/TeddyConfig.h" 00026 #if defined( TEDDY_INCLUDE_LW_SCENE ) 00027 00028 00029 #include "Teddy/Imports/LWSceneFile.h" 00030 #include "Teddy/Imports/LWSceneParser.h" 00031 using namespace Teddy::Graphics; 00032 00033 00034 namespace Teddy { 00035 namespace Imports { 00036 00037 00038 /* 00039 BGImage < image path + filename> [(sequence)] 00040 FGImage <image path + filename> [(sequence)] 00041 FGAlphaImage < image path + filename> [(sequence)] 00042 00043 example: BGImage Images/Sky.tga 00044 example: BGImage Images/BldColor.tga 00045 00046 example: FGAlphaImage Images/BldAlpha.tga 00047 00048 The BGImage, FGImage and FGAlphaImage functions provides 00049 the path and filename for the background, foreground and 00050 foreground alpha channel images respectively. The paths 00051 are generated by checking the current content directory 00052 for the listed filenames. 00053 00054 In these examples if the current content directory is 00055 <c:\NewTek>, LightWave would attempt to load the files 00056 <c:\NewTek\Images\Sky.tga>, <c:\NewTek\Images\BldColor.tga> 00057 and <c:\NewTek\Images\BldAlpha.tga>. 00058 00059 It is possible to use image sequences for these functions. 00060 If an image sequence is chosen, a sequence identifier is 00061 appended to the image path and filename. An additional 00062 ImageSequenceInfo listing is also produced. (See Image 00063 Sequences Section 1.5) 00064 */ 00065 void LWSceneParser::BGImage(){ 00066 char *bg_image = file->read_string(); 00067 } 00068 00069 00070 void LWSceneParser::FGImage(){ 00071 char *fg_image = file->read_string(); 00072 } 00073 00074 00075 void LWSceneParser::FGAlphaImage(){ 00076 char *fg_alpha_image = file->read_string(); 00077 } 00078 00079 00080 /* 00081 FGDissolve <percentage> ¦ (envelope) 00082 00083 example: FGDissolve 0.750000 00084 00085 The FGDissolve function provides the dissolve 00086 percentage of the foreground image. This function 00087 is most widely used with an envelope to produce a 00088 smooth fade from a foreground image to the current 00089 scene. 00090 */ 00091 void LWSceneParser::FGDissolve(){ 00092 double fg_dissolve = file->read_double(); 00093 } 00094 00095 00096 /* 00097 FGFaderAlphaMode <flag> 00098 00099 example: FGFaderAlphaMode 1 00100 00101 The FGFaderAlphaMode flag activates the foreground 00102 fader alpha mode. This modes provides an additional 00103 type of Alpha channel image compositing. 00104 00105 <flag>: 00106 0 - Off (No Listing) 00107 1 - On (Listing) 00108 */ 00109 void LWSceneParser::FGFaderAlphaMode(){ 00110 int fg_fader_alpha_mode = file->read_int(); 00111 } 00112 00113 00114 /* 00115 Additional: ImageSequenceInfo <frame offset> <loop flag> <loop length> 00116 00117 The ImageSequenceInfo listing is produced only when 00118 an image sequence is chosen. It provides optional 00119 information for the image sequence. (See Image 00120 Sequences Section 1.5) 00121 */ 00122 void LWSceneParser::ImageSequenceInfo(){ 00123 int frame_offset = file->read_int(); 00124 int loop_flag = file->read_int(); 00125 int loop_length = file->read_int(); 00126 } 00127 00128 00129 /* 00130 ForegroundKey <flag> 00131 00132 example: ForegroundKey 1 00133 00134 The ForegroundKey flag activates the foreground keying 00135 function in the image composting process of LightWave. 00136 This function allows the user to set a HighClipColor 00137 and a LowClipColor for the clipping of the foreground 00138 image. 00139 00140 <flag>: 00141 0 - Off (No Listing) 00142 1 - On (Listing plus additional listings) 00143 */ 00144 void LWSceneParser::ForegroundKey(){ 00145 int foreground_key = file->read_int(); 00146 } 00147 00148 /* 00149 Additional: LowClipColor <Red value> <Green value> <Blue value> 00150 00151 Additional: HighClipColor <Red value> <Green value> <Blue value> 00152 00153 example: LowClipColor 0 0 0 00154 00155 example: HighClipColor 125 125 125 00156 00157 The LowClipColor and HighClipColor functions provides 00158 the "darkest" and the "brightest" RGB color respectively 00159 for the ForegroundKey function. 00160 */ 00161 void LWSceneParser::LowClipColor(){ 00162 double red = file->read_double(); 00163 double green = file->read_double(); 00164 double blue = file->read_double(); 00165 } 00166 void LWSceneParser::HighClipColor(){ 00167 double red = file->read_double(); 00168 double green = file->read_double(); 00169 double blue = file->read_double(); 00170 } 00171 00172 00173 /* 00174 BackdropColor <Red value> <Green value> <Blue value> 00175 00176 example: BackdropColor 125 125 125 00177 00178 The BackdropColor function provides the RGB values 00179 for the backdrop color. These values are used only 00180 when the SolidBackdrop flag is turned on. 00181 */ 00182 void LWSceneParser::BackdropColor(){ 00183 double red = file->read_double(); 00184 double green = file->read_double(); 00185 double blue = file->read_double(); 00186 } 00187 00188 00189 /* 00190 SolidBackdrop <flag> 00191 00192 example: SolidBackdrop 1 00193 00194 The SolidBackdrop flag activates a single color 00195 backdrop. If the flag is turned off, a gradient 00196 backdrop is produced using the RGB color values 00197 provided in the Backdrop Color, Zenith Color, 00198 Sky Color, and Nadir Color listings. 00199 00200 <flag>: 00201 0 - Off (Gradient Backdrop) 00202 1 - On (SolidBackdrop) 00203 */ 00204 void LWSceneParser::SolidBackdrop(){ 00205 int solid_backdrop = file->read_int(); 00206 } 00207 00208 00209 /* 00210 The ZenithColor, SkyColor, GroundColor, and Nadir 00211 Color functions provide the RBG values for the 00212 gradient backdrop. These values are used only when 00213 the SolidBackdrop flag is turned off. 00214 */ 00215 void LWSceneParser::ZenithColor(){ 00216 double red = file->read_double(); 00217 double green = file->read_double(); 00218 double blue = file->read_double(); 00219 zenith_color = Color( red, green, blue ); 00220 } 00221 Color LWSceneParser::getZenithColor(){ 00222 return zenith_color; 00223 } 00224 void LWSceneParser::SkyColor(){ 00225 double red = file->read_double(); 00226 double green = file->read_double(); 00227 double blue = file->read_double(); 00228 sky_color = Color( red, green, blue ); 00229 } 00230 Color LWSceneParser::getSkyColor(){ 00231 return sky_color; 00232 } 00233 void LWSceneParser::GroundColor(){ 00234 double red = file->read_double(); 00235 double green = file->read_double(); 00236 double blue = file->read_double(); 00237 ground_color = Color( red, green, blue ); 00238 } 00239 Color LWSceneParser::getGroundColor(){ 00240 return ground_color; 00241 } 00242 void LWSceneParser::NadirColor(){ 00243 double red = file->read_double(); 00244 double green = file->read_double(); 00245 double blue = file->read_double(); 00246 nadir_color = Color( red, green, blue ); 00247 } 00248 Color LWSceneParser::getNadirColor(){ 00249 return nadir_color; 00250 } 00251 00252 void LWSceneParser::SkySqueezeAmount(){} 00253 void LWSceneParser::GroundSqueezeAmount(){} 00254 00255 00256 /* 00257 FogType <value> 00258 00259 example: FogType 1 00260 00261 The FogType function determines which type of fog 00262 will be generated during the rendering process. If 00263 the Fog effect is turned on in LightWave, 00264 additional listings are produced. 00265 00266 <value>: 00267 0 - Off 00268 1 - Linear 00269 2 - NonLinear 1 00270 3 - NonLinear 2 00271 */ 00272 void LWSceneParser::FogType(){ 00273 int fog_type = file->read_int(); 00274 } 00275 00276 00277 /* 00278 Additional: FogMinDist <Distance> ¦ (envelope) 00279 00280 example: FogMinDist 25.000000 00281 00282 The FogMinDist function provides the distance from 00283 the camera that the fog will begin. This functions 00284 value can be fluctuated over time with an envelope. 00285 If an envelope is chosen, the distance value is 00286 replace with an envelope identifier. 00287 */ 00288 void LWSceneParser::FogMinDist(){ 00289 double fog_min_dist = file->read_double(); 00290 } 00291 00292 00293 /* 00294 Additional: FogMaxDist <Distance> ¦ (envelope) 00295 00296 example: FogMaxDist 350.00000 00297 00298 The Fog MaxDist function provides the distance from 00299 camera that objects in the fog will remain visible. 00300 This functions value can be fluctuated over time with 00301 an envelope. If an envelope is chosen, the distance 00302 value is replace with an envelope identifier. 00303 */ 00304 void LWSceneParser::FogMaxDist(){ 00305 double fog_max_dist = file->read_double(); 00306 } 00307 00308 00309 /* 00310 Additional: FogMinAmount <percentage> ¦ (envelope) 00311 00312 example: FogMinAmount 0.250000 00313 00314 The FogMinAmount function provides the lower bounding 00315 value for the density (amount) of fog in the scene. 00316 */ 00317 void LWSceneParser::FogMinAmount(){ 00318 double fog_min_amount = file->read_double(); 00319 } 00320 00321 00322 /* 00323 Additional: FogMaxAmount <percentage> ¦ (envelope) 00324 00325 example: FogMaxAmount 0.750000 00326 00327 The FogMaxAmount function provides the upper bounding 00328 value for the density (amount) of fog in the scene. 00329 */ 00330 void LWSceneParser::FogMaxAmount(){ 00331 double fog_max_amount = file->read_double(); 00332 } 00333 00334 00335 /* 00336 Additional: FogColor <Red value> <Green value> <Blue value> 00337 00338 example: FogColor 200 200 215 00339 00340 The FogColor function provides the RGB values for the 00341 color of the fog. These values are used only when the 00342 BackdropFog flag is turned off. 00343 */ 00344 void LWSceneParser::FogColor(){ 00345 double red = file->read_double(); 00346 double green = file->read_double(); 00347 double blue = file->read_double(); 00348 } 00349 00350 00351 /* 00352 Additional: BackdropFog <flag> 00353 00354 example: BackdropFog 1 00355 00356 The BackdropFog flag determines how the fog will 00357 be colored. If the flag is on, the fog will use 00358 the backdrop color. If the flag is off, it will 00359 use the values provided in the FogColor function. 00360 00361 <flag>: 00362 0 - Use FogColor 00363 1 - Use Backdrop Colors 00364 */ 00365 void LWSceneParser::BackdropFog(){ 00366 int backdrop_fog = file->read_int(); 00367 } 00368 00369 00370 /* 00371 DitherIntensity <value> 00372 00373 example: DitherIntensity 2 00374 00375 The DitherIntensity function provides the type of 00376 dithering to be used during the rendering process. 00377 00378 <value>: 00379 0 - Off 00380 1 - Normal 00381 2 - 2 x Normal 00382 3 - 4 x Normal 00383 */ 00384 void LWSceneParser::DitherIntensity(){ 00385 int dither_intensity = file->read_int(); 00386 } 00387 00388 00389 /* 00390 AnimatedDither <flag> 00391 00392 example: AnimatedDither 1 00393 00394 The AnimatedDither flag activates the animated dither function. 00395 This will use an alternate dithering pattern frame by frame. 00396 00397 <flag>: 00398 0 - Off 00399 1 - On 00400 */ 00401 void LWSceneParser::AnimatedDither(){ 00402 int animated_dither = file->read_int(); 00403 } 00404 00405 00406 /* 00407 Saturation <percentage> ¦ (envelope) 00408 00409 example: Saturation 0.350000 00410 00411 The Saturation function provides the percentage of 00412 color saturation to be used during the rendering 00413 process. The function produces a listing only 00414 when set below 100%. 00415 */ 00416 void LWSceneParser::Saturation(){ 00417 double saturation = file->read_double(); 00418 } 00419 00420 00421 /* 00422 GlowEffect <flag> 00423 00424 example: GlowEffect 1 00425 00426 The GlowEffect flag activates the glow effect for 00427 the rendering process. When this function is turned 00428 on, it allows any surface that has it's glow effect 00429 flag turned on to be affected by the glow post-process. 00430 This function, when turned on, produces a listing plus 00431 additional option listings. 00432 00433 <flag>: 00434 0 - Off (No Listing) 00435 1 - On (Listing plus additional listings) 00436 */ 00437 void LWSceneParser::GlowEffect(){ 00438 int glow_effect = file->read_int(); 00439 } 00440 00441 00442 /* 00443 Additional: GlowIntensity <percentage> ¦ (envelope) 00444 00445 example: GlowIntensity 1.000000 00446 00447 The GlowIntensity provides the percentage of glow intensity 00448 (brightness) that the glow post-process will produce. 00449 */ 00450 void LWSceneParser::GlowIntensity(){ 00451 double glow_intensity = file->read_double(); 00452 } 00453 00454 00455 /* 00456 Additional: GlowRadius <pixels> ¦ (envelope) 00457 00458 example: GlowRadius 8.000000 00459 00460 The GlowRadius provides the glow distance, in pixels, 00461 that the glow post-process will produce. 00462 */ 00463 void LWSceneParser::GlowRadius(){ 00464 double glow_radius = file->read_double(); 00465 } 00466 00467 00468 }; // namespace Imports 00469 }; // namespace Teddy 00470 00471 00472 #endif // TEDDY_INCLUDE_LW_SCENE 00473 00474 00475 /* 00476 00477 The Effects section contains the information that relates 00478 to the different effects that are available in a LightWave 00479 scene. 00480 00481 The following is a list of Effects functions that are 00482 listed in the order in which they appear in the scene file. 00483 00484 BGImage 00485 FGImage 00486 FGAlphaImage 00487 FGDissolve 00488 FGFaderAlphaMode 00489 ForegroundKey 00490 LowClipColor 00491 HighClipColor 00492 SolidBackdrop * 00493 BackdropColor * 00494 ZenithColor * 00495 SkyColor * 00496 GroundColor * 00497 NadirColor * 00498 FogType * 00499 FogMinDist 00500 FogMaxDist 00501 FogMinAmount 00502 FogMaxAmount 00503 FogColor 00504 BackdropFog 00505 DitherIntensity * 00506 AnimatedDither * 00507 Saturation 00508 GlowEffect 00509 GlowIntensity 00510 GlowRadius 00511 DataOverlay 00512 DataOverlayLabel * 00513 */ 00514