Panda3D
|
00001 // Filename: config_gobj.cxx 00002 // Created by: drose (01Oct99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #include "animateVerticesRequest.h" 00016 #include "bufferContext.h" 00017 #include "config_util.h" 00018 #include "config_gobj.h" 00019 #include "geom.h" 00020 #include "geomCacheEntry.h" 00021 #include "geomMunger.h" 00022 #include "geomPrimitive.h" 00023 #include "geomTriangles.h" 00024 #include "geomTristrips.h" 00025 #include "geomTrifans.h" 00026 #include "geomLines.h" 00027 #include "geomLinestrips.h" 00028 #include "geomPoints.h" 00029 #include "geomVertexArrayData.h" 00030 #include "geomVertexArrayFormat.h" 00031 #include "geomVertexData.h" 00032 #include "geomVertexFormat.h" 00033 #include "material.h" 00034 #include "occlusionQueryContext.h" 00035 #include "orthographicLens.h" 00036 #include "matrixLens.h" 00037 #include "perspectiveLens.h" 00038 #include "lens.h" 00039 #include "queryContext.h" 00040 #include "sliderTable.h" 00041 #include "texture.h" 00042 #include "texturePoolFilter.h" 00043 #include "textureReloadRequest.h" 00044 #include "textureStage.h" 00045 #include "textureContext.h" 00046 #include "shader.h" 00047 #include "shaderContext.h" 00048 #include "transformBlend.h" 00049 #include "transformBlendTable.h" 00050 #include "transformTable.h" 00051 #include "userVertexSlider.h" 00052 #include "userVertexTransform.h" 00053 #include "vertexDataBuffer.h" 00054 #include "vertexTransform.h" 00055 #include "vertexSlider.h" 00056 #include "videoTexture.h" 00057 #include "geomContext.h" 00058 #include "vertexBufferContext.h" 00059 #include "indexBufferContext.h" 00060 #include "internalName.h" 00061 00062 #include "dconfig.h" 00063 #include "string_utils.h" 00064 00065 Configure(config_gobj); 00066 NotifyCategoryDef(gobj, ""); 00067 00068 ConfigVariableInt max_texture_dimension 00069 ("max-texture-dimension", -1, 00070 PRC_DESC("Set this to the maximum size a texture is allowed to be in either " 00071 "dimension. This is generally intended as a simple way to restrict " 00072 "texture sizes for limited graphics cards. When this is greater " 00073 "than zero, each texture image loaded from a file (but only those " 00074 "loaded from a file) will be automatically scaled down, if " 00075 "necessary, so that neither dimension is larger than this value. " 00076 "If this is less than zero, the size limit is taken from the " 00077 "primary GSG. If this is exactly zero, there is no limit.")); 00078 00079 ConfigVariableDouble texture_scale 00080 ("texture-scale", 1.0, 00081 PRC_DESC("This is a global scale factor that is applied to each texture " 00082 "as it is loaded from disk. For instance, a value of 0.5 will " 00083 "reduce each texture to one-half its size in each dimension. This " 00084 "scale factor is applied before textures-power-2 or " 00085 "max-texture-dimension.")); 00086 00087 ConfigVariableInt texture_scale_limit 00088 ("texture-scale-limit", 4, 00089 PRC_DESC("This specifies the limit below which texture-scale will not " 00090 "reduce a texture image. This is a single dimension which applies " 00091 "to both X and Y.")); 00092 00093 ConfigVariableList exclude_texture_scale 00094 ("exclude-texture-scale", 00095 PRC_DESC("This is a list of glob patterns for texture filenames " 00096 "(excluding the directory part of the filename, but including " 00097 "the extension); for instance, 'digits_*.png'. Any texture " 00098 "filenames that match one of these patterns will not be affected " 00099 "by max-texture-dimension or texture-scale.")); 00100 00101 ConfigVariableBool keep_texture_ram 00102 ("keep-texture-ram", false, 00103 PRC_DESC("Set this to true to retain the ram image for each texture after it " 00104 "has been prepared with the GSG. This will allow the texture to be " 00105 "prepared with multiple GSG's, or to be re-prepared later after it is " 00106 "explicitly released from the GSG, without having to reread the " 00107 "texture image from disk; but it will consume memory somewhat " 00108 "wastefully.")); 00109 00110 ConfigVariableBool compressed_textures 00111 ("compressed-textures", false, 00112 PRC_DESC("Set this to true to compress textures as they are loaded into " 00113 "texture memory, if the driver supports this. Specifically, this " 00114 "changes the meaning of set_compression(Texture::CM_default) to " 00115 "Texture::CM_on.")); 00116 00117 ConfigVariableBool driver_compress_textures 00118 ("driver-compress-textures", false, 00119 PRC_DESC("Set this true to ask the graphics driver to compress textures, " 00120 "rather than compressing them in-memory first. Depending on " 00121 "your graphics driver, you may or may not get better performance " 00122 "or results by setting this true. Setting it true may also " 00123 "allow you to take advantage of some exotic compression algorithm " 00124 "other than DXT1/3/5 that your graphics driver supports, but " 00125 "which is unknown to Panda. If the libsquish library is not " 00126 "compiled into Panda, textures cannot be compressed in-memory, " 00127 "and will always be handed to the graphics driver, regardless " 00128 "of this setting.")); 00129 00130 ConfigVariableBool driver_generate_mipmaps 00131 ("driver-generate-mipmaps", true, 00132 PRC_DESC("Set this true to use the hardware to generate mipmaps " 00133 "automatically in all cases, if supported. Set it false " 00134 "to generate mipmaps in software when possible.")); 00135 00136 ConfigVariableBool vertex_buffers 00137 ("vertex-buffers", true, 00138 PRC_DESC("Set this true to allow the use of vertex buffers (or buffer " 00139 "objects, as OpenGL dubs them) for rendering vertex data. This " 00140 "can greatly improve rendering performance on " 00141 "higher-end graphics cards, at the cost of some additional " 00142 "graphics memory (which might otherwise be used for textures " 00143 "or offscreen buffers). On lower-end graphics cards this will " 00144 "make little or no difference.")); 00145 00146 ConfigVariableBool vertex_arrays 00147 ("vertex-arrays", true, 00148 PRC_DESC("Set this true to allow the use of vertex arrays for rendering " 00149 "OpenGL vertex data. This, or vertex buffers, is the normal " 00150 "way of issuing vertices ever since OpenGL 1.1, and you " 00151 "almost always want to have this set to true. However, some very " 00152 "buggy graphics drivers may have problems handling vertex arrays " 00153 "correctly, so if you are experiencing problems you might try " 00154 "setting this to false. If this is false, Panda will fall back " 00155 "to using immediate-mode commands like glVertex3f(), etc., to " 00156 "issue the vertices, which is potentially much slower than " 00157 "vertex arrays. Setting this false also disables vertex buffers, " 00158 "effectively ignoring the setting of the vertex-buffers variable " 00159 "(since vertex buffers are a special case of vertex arrays in " 00160 "OpenGL). This variable is normally not enabled in a production " 00161 "build. This has no effect on DirectX rendering.")); 00162 00163 ConfigVariableBool display_lists 00164 ("display-lists", false, 00165 PRC_DESC("Set this true to allow the use of OpenGL display lists for " 00166 "rendering static geometry. On some systems, this can result " 00167 "in a performance improvement over vertex buffers alone; on " 00168 "other systems (particularly low-end systems) it makes little to " 00169 "no difference. On some systems, using display lists can actually " 00170 "reduce performance. This has no effect on DirectX rendering or " 00171 "on dynamic geometry (e.g. soft-skinned animation).")); 00172 00173 ConfigVariableBool hardware_animated_vertices 00174 ("hardware-animated-vertices", false, 00175 PRC_DESC("Set this true to allow the transforming of soft-skinned " 00176 "animated vertices via hardware, if supported, or false always " 00177 "to perform the vertex animation via software within Panda. " 00178 "If you have a card that supports this, and your scene does " 00179 "not contain too many vertices already, this can provide a " 00180 "performance boost by offloading some work from your CPU onto " 00181 "your graphics card. It may also help by reducing the bandwidth " 00182 "necessary on your computer's bus. However, in some cases it " 00183 "may actually reduce performance.")); 00184 00185 ConfigVariableBool hardware_point_sprites 00186 ("hardware-point-sprites", true, 00187 PRC_DESC("Set this true to allow the use of hardware extensions when " 00188 "rendering perspective-scaled points and point sprites. When " 00189 "false, these large points are always simulated via quads " 00190 "computed in software, even if the hardware claims it can " 00191 "support them directly.")); 00192 00193 ConfigVariableBool hardware_points 00194 ("hardware-points", true, 00195 PRC_DESC("Set this true to allow the use of hardware extensions when " 00196 "rendering large points. When false, large points (even if " 00197 "untextured) will be simulated via quads computed in software.")); 00198 00199 ConfigVariableBool singular_points 00200 ("singular-points", true, 00201 PRC_DESC("Set this true to insist that when RenderModeAttrib::M_points is " 00202 "used, each point appears only once in the result, even if " 00203 "the vertex is referenced multiple times. This is particularly " 00204 "important when rendering points from a triangle mesh and you " 00205 "don't want the points to appear repeatedly.")); 00206 00207 ConfigVariableBool matrix_palette 00208 ("matrix-palette", false, 00209 PRC_DESC("Set this true to allow the use of the matrix palette when " 00210 "animating vertices in hardware. The matrix palette is " 00211 "not supported by all devices, but if it is, using " 00212 "it can allow animation of more sophisticated meshes " 00213 "in hardware, and it can also improve the " 00214 "performance of animating some simpler meshes. Without " 00215 "this option, certain meshes will have to be animated in " 00216 "software. However, this option is not enabled by default, " 00217 "because its support seems to be buggy in certain drivers " 00218 "(ATI FireGL T2 8.103 in particular.)")); 00219 00220 ConfigVariableBool display_list_animation 00221 ("display-list-animation", false, 00222 PRC_DESC("Set this true to allow the use of OpenGL display lists for " 00223 "rendering animated geometry (when the geometry is animated " 00224 "by the hardware). This is not on by default because there " 00225 "appear to be some driver issues with this on my FireGL T2, " 00226 "but it should be perfectly doable in principle, and might get " 00227 "you a small performance boost.")); 00228 00229 ConfigVariableBool connect_triangle_strips 00230 ("connect-triangle-strips", true, 00231 PRC_DESC("Set this true to send a batch of triangle strips to the graphics " 00232 "card as one long triangle strip, connected by degenerate " 00233 "triangles, or false to send them as separate triangle strips " 00234 "with no degenerate triangles. On PC hardware, using one long " 00235 "triangle strip may help performance by reducing the number " 00236 "of separate graphics calls that have to be made.")); 00237 00238 ConfigVariableBool preserve_triangle_strips 00239 ("preserve-triangle-strips", false, 00240 PRC_DESC("Set this true to indicate a preference for keeping triangle strips " 00241 "when possible, instead of decomposing them into triangles. When " 00242 "this is true, flatten_strong and unify operations may be less " 00243 "effective at combining multiple Geoms together, but they will " 00244 "not implicitly decompose triangle strips.")); 00245 00246 ConfigVariableBool dump_generated_shaders 00247 ("dump-generated-shaders", false, 00248 PRC_DESC("Set this true to cause all generated shaders to be written " 00249 "to disk. This is useful for debugging broken shader " 00250 "generators.")); 00251 00252 ConfigVariableBool enforce_attrib_lock 00253 ("enforce-attrib-lock", true, 00254 PRC_DESC("When a MaterialAttrib, TextureAttrib, or LightAttrib is " 00255 "constructed, the corresponding Material, Texture, or Light " 00256 "is 'attrib locked.' The attrib lock prevents qualitative " 00257 "changes to the object. This makes it possible to hardwire " 00258 "information about material, light, and texture properties " 00259 "into generated shaders. This config variable can disable " 00260 "the attrib lock. Disabling the lock will break the shader " 00261 "generator, but doing so may be necessary for backward " 00262 "compatibility with old code.")); 00263 00264 ConfigVariableBool vertices_float64 00265 ("vertices-float64", false, 00266 PRC_DESC("When this is true, the default float format for vertices " 00267 "will be a 64-bit double-precision float, instead " 00268 "of the normal 32-bit single-precision float. This must be set " 00269 "at static init time to have the broadest effect. You almost never " 00270 "want to set this true, since current hardware does not support " 00271 "double-precision vertices, and setting this will just require the " 00272 "driver to downsample the vertices at load time, making everything " 00273 "slower.")); 00274 00275 ConfigVariableInt vertex_column_alignment 00276 ("vertex-column-alignment", 1, 00277 PRC_DESC("This specifies the default byte alignment for each column of " 00278 "data within a GeomVertexData when it is assembled using the default " 00279 "interfaces. Normally, you should not change this config variable " 00280 "(which would change this value globally), but instead specify any " 00281 "alignment requirements on a per-column basis as you construct a " 00282 "GeomVertexFormat. Setting this value globally could result in " 00283 "much needless wasted space in all vertex data objects, but it " 00284 "could be useful for simple experiments. Also see " 00285 "vertex-animation-align-16 for a variable that controls " 00286 "this alignment for the vertex animation columns only.")); 00287 00288 ConfigVariableBool vertex_animation_align_16 00289 ("vertex-animation-align-16", 00290 #ifdef LINMATH_ALIGN 00291 true, 00292 #else 00293 false, 00294 #endif 00295 PRC_DESC("If this is true, then animated vertices will be created with 4-component " 00296 "floats and aligned to 16-byte boundaries, to allow efficient vectorization " 00297 "(e.g. SSE2) operations when computing animations. If this is false, " 00298 "animated vertices will be packed as tightly as possible, in the normal way, " 00299 "which will optimize the amount of memory that must be sent to the graphics " 00300 "card, but prevent the use of SSE2 to calculate animation. This does not " 00301 "affect unanimated vertices, which are always packed tightly. This also " 00302 "impacts only vertex formats created within Panda subsystems; custom " 00303 "vertex formats are not affected.")); 00304 00305 ConfigVariableEnum<AutoTextureScale> textures_power_2 00306 ("textures-power-2", ATS_down, 00307 PRC_DESC("Specify whether textures should automatically be constrained to " 00308 "dimensions which are a power of 2 when they are loaded from " 00309 "disk. Set this to 'none' to disable this feature, or to " 00310 "'down' or 'up' to scale down or up to the nearest power of 2, " 00311 "respectively. This only has effect on textures which are not " 00312 "already a power of 2.")); 00313 00314 ConfigVariableEnum<AutoTextureScale> textures_square 00315 ("textures-square", ATS_none, 00316 PRC_DESC("Specify whether textures should automatically be constrained to " 00317 "a square aspect ratio when they are loaded from disk. Set this " 00318 "to 'none', 'down', or 'up'. See textures-power-2.")); 00319 00320 ConfigVariableBool textures_auto_power_2 00321 ("textures-auto-power-2", false, 00322 PRC_DESC("If this is true, then panda will wait until you open a window, " 00323 "and then ask the window if it supports non-power-of-two textures. " 00324 "If so, then the config variable textures_power_2 will " 00325 "automatically be adjusted. The pitfall of doing this is that if " 00326 "you then open a second window that doesn't support the same " 00327 "capabilities, it will have no choice but to print an error message.")); 00328 00329 ConfigVariableBool textures_header_only 00330 ("textures-header-only", false, 00331 PRC_DESC("If this is true, texture images will not actually be loaded from " 00332 "disk, but the image header information will be consulted to verify " 00333 "number of channels and so forth. The texture images themselves " 00334 "will be generated in a default blue color.")); 00335 00336 ConfigVariableInt simple_image_size 00337 ("simple-image-size", "16 16", 00338 PRC_DESC("This is an x y pair that specifies the maximum size of an " 00339 "automatically-generated " 00340 "texture simple image. The simple image can displayed before " 00341 "the texture has been loaded from disk.")); 00342 00343 ConfigVariableDouble simple_image_threshold 00344 ("simple-image-threshold", 0.1, 00345 PRC_DESC("This is a value that indicates how closely a texture's " 00346 "generated simple " 00347 "image should approximate the original image. The smaller the " 00348 "number, the closer the match; small numbers will result in " 00349 "simple images close to the maximum size specified by " 00350 "simple-image-size. Larger numbers will result in smaller " 00351 "simple images. Generally the value should be considerably " 00352 "less than 1.")); 00353 00354 ConfigVariableEnum<ShaderUtilization> shader_utilization 00355 ("shader-utilization", SUT_none, 00356 PRC_DESC("At times, panda may generate shaders. This variable controls what " 00357 "kinds of shaders can be generated. If you set it to SUT_none, " 00358 "shader generation will be be disabled. If you set it to SUT_basic, " 00359 "then DX9 shaders may be generated, if you set it to SUT_advanced, " 00360 "then DX10 shaders may be generated.")); 00361 00362 ConfigVariableBool shader_auto_utilization 00363 ("shader-auto-utilization", false, 00364 PRC_DESC("If this is true, then panda will wait until you open a window, " 00365 "and then ask the window if it supports basic or advanced shaders. " 00366 "If so, then the config variable shader-utilization will " 00367 "automatically be adusted. The pitfall of doing this is that if " 00368 "you then open a second window that doesn't support the same " 00369 "capabilities, it will have no choice but to print an error message.")); 00370 00371 ConfigVariableInt geom_cache_size 00372 ("geom-cache-size", 5000, 00373 PRC_DESC("Specifies the maximum number of entries in the cache " 00374 "for storing pre-processed data for rendering " 00375 "vertices. This limit is flexible, and may be " 00376 "temporarily exceeded if many different Geoms are " 00377 "pre-processed during the space of a single frame.")); 00378 00379 ConfigVariableInt geom_cache_min_frames 00380 ("geom-cache-min-frames", 1, 00381 PRC_DESC("Specifies the minimum number of frames any one particular " 00382 "object will remain in the geom cache, even if geom-cache-size " 00383 "is exceeded.")); 00384 00385 ConfigVariableInt released_vbuffer_cache_size 00386 ("released-vbuffer-cache-size", 1048576, 00387 PRC_DESC("Specifies the size in bytes of the cache of vertex " 00388 "buffers that have recently been released. If a new vertex " 00389 "buffer is prepared while a recently-released one of the same " 00390 "size is still in the cache, that same buffer is recycled. This " 00391 "cuts down on the overhead of creating and destroying vertex " 00392 "buffers on the graphics card.")); 00393 00394 ConfigVariableInt released_ibuffer_cache_size 00395 ("released-ibuffer-cache-size", 102400, 00396 PRC_DESC("Specifies the size in bytes of the cache of index " 00397 "buffers that have recently been released. If a new index " 00398 "buffer is prepared while a recently-released one of the same " 00399 "size is still in the cache, that same buffer is recycled. This " 00400 "cuts down on the overhead of creating and destroying index " 00401 "buffers on the graphics card.")); 00402 00403 ConfigVariableDouble default_near 00404 ("default-near", 1.0, 00405 PRC_DESC("The default near clipping distance for all cameras.")); 00406 00407 ConfigVariableDouble default_far 00408 ("default-far", 100000.0, 00409 PRC_DESC("The default far clipping distance for all cameras.")); 00410 00411 ConfigVariableDouble lens_far_limit 00412 ("lens-far-limit", 0.0000001, 00413 PRC_DESC("This number is used to reduce the effect of numeric inaccuracies " 00414 "in Lens::extrude(). It should be a very small, positive number, " 00415 "almost zero; set it larger if Lens::extrude() returns values " 00416 "that appear meaningless, and set it smaller if you appear to be " 00417 "unable to move the far plane out far enough.")); 00418 00419 ConfigVariableDouble default_fov 00420 ("default-fov", 30.0, 00421 PRC_DESC("The default field of view in degrees for all cameras. This is " 00422 "defined as a min_fov; that is, it is the field-of-view for the " 00423 "smallest of the X and Y sizes of the window, which is usually " 00424 "the vertical field of view (windows are usually wider than they " 00425 "are tall). For a 4x3 window, 30 degrees vertical is roughly " 00426 "40 degrees horizontal.")); 00427 00428 ConfigVariableDouble default_iod 00429 ("default-iod", 0.2, 00430 PRC_DESC("The default interocular distance for stereo cameras.")); 00431 00432 ConfigVariableDouble default_converge 00433 ("default-converge", 25.0, 00434 PRC_DESC("The default convergence distance for stereo cameras.")); 00435 00436 ConfigVariableDouble default_keystone 00437 ("default-keystone", 0.0f, 00438 PRC_DESC("The default keystone correction, as an x y pair, for all cameras.")); 00439 00440 ConfigVariableFilename vertex_save_file_directory 00441 ("vertex-save-file-directory", "", 00442 PRC_DESC("The directory in which the saved vertex data file is created " 00443 "for saving vertex buffers that have been evicted from RAM. If " 00444 "this is the empty string, or an invalid directory, a system " 00445 "default directory will be chosen.")); 00446 00447 ConfigVariableString vertex_save_file_prefix 00448 ("vertex-save-file-prefix", "p3d_vdata_", 00449 PRC_DESC("A prefix used to generate the filename for the saved vertex " 00450 "data file which is created for saving vertex buffers that have " 00451 "been evicted from RAM. A uniquifying sequence number and " 00452 "filename extension will be appended to this string.")); 00453 00454 ConfigVariableInt vertex_data_small_size 00455 ("vertex-data-small-size", 64, 00456 PRC_DESC("When a GeomVertexArrayData is this number of bytes or smaller, it " 00457 "is deemed too small to pay the overhead of paging it in and out, " 00458 "and it is permanently retained resident.")); 00459 00460 ConfigVariableInt vertex_data_page_threads 00461 ("vertex-data-page-threads", 1, 00462 PRC_DESC("When this is nonzero (and Panda has been compiled with thread " 00463 "support) then this number of sub-threads will be spawned to " 00464 "evict vertex pages to disk and read them back again. When this " 00465 "is 0, this work will be done in the main thread, which may " 00466 "introduce occasional random chugs in rendering.")); 00467 00468 ConfigVariableInt graphics_memory_limit 00469 ("graphics-memory-limit", -1, 00470 PRC_DESC("This is a default limit that is imposed on each GSG at " 00471 "GSG creation time. It limits the total amount of graphics " 00472 "memory, including texture memory and vertex buffer memory, " 00473 "that will be consumed by the GSG, regardless of whether the " 00474 "hardware claims to provide more graphics memory than this. " 00475 "It is useful to put a ceiling on graphics memory consumed, since " 00476 "some drivers seem to allow the application to consume more " 00477 "memory than the hardware can realistically support. " 00478 "Set this to -1 to have no limit other than the normal " 00479 "hardware-imposed limit.")); 00480 00481 ConfigVariableDouble adaptive_lru_weight 00482 ("adaptive-lru-weight", 0.2, 00483 PRC_DESC("Specifies the weight factor used to compute the AdaptiveLru's " 00484 "exponential moving average.")); 00485 00486 ConfigVariableInt adaptive_lru_max_updates_per_frame 00487 ("adaptive-lru-max-updates-per-frame", 40, 00488 PRC_DESC("The number of pages the AdaptiveLru class will update per " 00489 "frame. Do not set this too high or it will degrade " 00490 "performance.")); 00491 00492 ConfigVariableDouble async_load_delay 00493 ("async-load-delay", 0.0, 00494 PRC_DESC("If this is nonzero, it represents an artificial delay, " 00495 "in seconds, that is imposed on every asynchronous load attempt " 00496 "(within the thread). Its purpose is to help debug errors that " 00497 "may occur when an asynchronous load is delayed. The " 00498 "delay is per-model, and all aync loads will be queued " 00499 "up behind the delay--it is as if the time it takes to read a " 00500 "file is increased by this amount per read.")); 00501 00502 ConfigVariableInt lens_geom_segments 00503 ("lens-geom-segments", 50, 00504 PRC_DESC("This is the number of times to subdivide the visualization " 00505 "wireframe created when Lens::make_geometry() (or " 00506 "LensNode::show_frustum()) is called, for representing accurate " 00507 "curves. Note that this is only " 00508 "used for a nonlinear lens such as a cylindrical or fisheye " 00509 "lens; for a normal perspective or orthographic lens, the " 00510 "wireframe is not subdivided.")); 00511 00512 ConfigureFn(config_gobj) { 00513 AnimateVerticesRequest::init_type(); 00514 BufferContext::init_type(); 00515 Geom::init_type(); 00516 GeomCacheEntry::init_type(); 00517 GeomPipelineReader::init_type(); 00518 GeomContext::init_type(); 00519 GeomLines::init_type(); 00520 GeomLinestrips::init_type(); 00521 GeomMunger::init_type(); 00522 GeomPoints::init_type(); 00523 GeomPrimitive::init_type(); 00524 GeomPrimitivePipelineReader::init_type(); 00525 GeomTriangles::init_type(); 00526 GeomTrifans::init_type(); 00527 GeomTristrips::init_type(); 00528 GeomVertexArrayData::init_type(); 00529 GeomVertexArrayDataHandle::init_type(); 00530 GeomVertexArrayFormat::init_type(); 00531 GeomVertexData::init_type(); 00532 GeomVertexDataPipelineReader::init_type(); 00533 GeomVertexDataPipelineWriter::init_type(); 00534 GeomVertexFormat::init_type(); 00535 IndexBufferContext::init_type(); 00536 InternalName::init_type(); 00537 Lens::init_type(); 00538 Material::init_type(); 00539 MatrixLens::init_type(); 00540 OcclusionQueryContext::init_type(); 00541 OrthographicLens::init_type(); 00542 PerspectiveLens::init_type(); 00543 QueryContext::init_type(); 00544 ShaderContext::init_type(); 00545 Shader::init_type(); 00546 SliderTable::init_type(); 00547 Texture::init_type(); 00548 TextureContext::init_type(); 00549 TexturePoolFilter::init_type(); 00550 TextureReloadRequest::init_type(); 00551 TextureStage::init_type(); 00552 TransformBlend::init_type(); 00553 TransformBlendTable::init_type(); 00554 TransformTable::init_type(); 00555 UserVertexSlider::init_type(); 00556 UserVertexTransform::init_type(); 00557 VertexBufferContext::init_type(); 00558 VertexSlider::init_type(); 00559 VertexDataBuffer::init_type(); 00560 VertexDataPage::init_type(); 00561 VertexTransform::init_type(); 00562 VideoTexture::init_type(); 00563 00564 //Registration of writeable object's creation 00565 //functions with BamReader's factory 00566 Geom::register_with_read_factory(); 00567 GeomLines::register_with_read_factory(); 00568 GeomLinestrips::register_with_read_factory(); 00569 GeomPoints::register_with_read_factory(); 00570 GeomTriangles::register_with_read_factory(); 00571 GeomTrifans::register_with_read_factory(); 00572 GeomTristrips::register_with_read_factory(); 00573 GeomVertexArrayData::register_with_read_factory(); 00574 GeomVertexArrayFormat::register_with_read_factory(); 00575 GeomVertexData::register_with_read_factory(); 00576 GeomVertexFormat::register_with_read_factory(); 00577 InternalName::register_with_read_factory(); 00578 Material::register_with_read_factory(); 00579 MatrixLens::register_with_read_factory(); 00580 OrthographicLens::register_with_read_factory(); 00581 PerspectiveLens::register_with_read_factory(); 00582 Shader::register_with_read_factory(); 00583 SliderTable::register_with_read_factory(); 00584 Texture::register_with_read_factory(); 00585 TextureStage::register_with_read_factory(); 00586 TransformBlendTable::register_with_read_factory(); 00587 TransformTable::register_with_read_factory(); 00588 UserVertexSlider::register_with_read_factory(); 00589 UserVertexTransform::register_with_read_factory(); 00590 } 00591 00592 ostream & 00593 operator << (ostream &out, ShaderUtilization sgc) { 00594 switch (sgc) { 00595 case SUT_none: 00596 return out << "none"; 00597 00598 case SUT_basic: 00599 return out << "basic"; 00600 00601 case SUT_advanced: 00602 return out << "advanced"; 00603 00604 case SUT_unspecified: 00605 return out << "unspecified"; 00606 } 00607 00608 return out << "**invalid ShaderUtilization (" << (int)sgc << ")**"; 00609 } 00610 00611 istream & 00612 operator >> (istream &in, ShaderUtilization &sgc) { 00613 string word; 00614 in >> word; 00615 00616 if (cmp_nocase(word, "none") == 0 || 00617 cmp_nocase(word, "0") == 0 || 00618 cmp_nocase(word, "#f") == 0 || 00619 (!word.empty() && tolower(word[0]) == 'f')) { 00620 sgc = SUT_none; 00621 00622 } else if (cmp_nocase(word, "basic") == 0 || 00623 cmp_nocase(word, "1") == 0 || 00624 cmp_nocase(word, "#t") == 0 || 00625 (!word.empty() && tolower(word[0]) == 't')) { 00626 sgc = SUT_basic; 00627 00628 } else if (cmp_nocase(word, "advanced") == 0) { 00629 sgc = SUT_advanced; 00630 00631 } else { 00632 gobj_cat->error() << "Invalid ShaderUtilization value: " << word << "\n"; 00633 sgc = SUT_none; 00634 } 00635 00636 return in; 00637 }