#include "llviewerprecompiledheaders.h"
#include "pipeline.h"
#include "audioengine.h"
#include "imageids.h"
#include "llerror.h"
#include "llviewercontrol.h"
#include "llfasttimer.h"
#include "llfontgl.h"
#include "llmemory.h"
#include "llmemtype.h"
#include "llnamevalue.h"
#include "llprimitive.h"
#include "llvolume.h"
#include "material_codes.h"
#include "timing.h"
#include "v3color.h"
#include "llui.h"
#include "llglheaders.h"
#include "llglimmediate.h"
#include "llagent.h"
#include "lldrawable.h"
#include "lldrawpoolalpha.h"
#include "lldrawpoolavatar.h"
#include "lldrawpoolground.h"
#include "lldrawpoolbump.h"
#include "lldrawpooltree.h"
#include "lldrawpoolwater.h"
#include "llface.h"
#include "llfeaturemanager.h"
#include "llfloatertelehub.h"
#include "llframestats.h"
#include "llgldbg.h"
#include "llhudmanager.h"
#include "lllightconstants.h"
#include "llresmgr.h"
#include "llselectmgr.h"
#include "llsky.h"
#include "lltracker.h"
#include "lltool.h"
#include "lltoolmgr.h"
#include "llviewercamera.h"
#include "llviewerimagelist.h"
#include "llviewerobject.h"
#include "llviewerobjectlist.h"
#include "llviewerparcelmgr.h"
#include "llviewerregion.h"
#include "llviewerwindow.h"
#include "llvoavatar.h"
#include "llvoground.h"
#include "llvosky.h"
#include "llvotree.h"
#include "llvovolume.h"
#include "llvosurfacepatch.h"
#include "llvowater.h"
#include "llvopartgroup.h"
#include "llworld.h"
#include "llcubemap.h"
#include "lldebugmessagebox.h"
#include "llglslshader.h"
#include "llviewerjoystick.h"
#include "llviewerdisplay.h"
#include "llwlparammanager.h"
#include "llwaterparammanager.h"
#include "llspatialpartition.h"
#include "llmutelist.h"
Go to the source code of this file.
Copyright (c) 2005-2008, Linden Research, Inc.
Second Life Viewer Source Code The source code in this file ("Source Code") is provided by Linden Lab to you under the terms of the GNU General Public License, version 2.0 ("GPL"), unless you have obtained a separate licensing agreement ("Other License"), formally executed by you and Linden Lab. Terms of the GPL can be found in doc/GPL-license.txt in this distribution, or online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
There are special exceptions to the terms and conditions of the GPL as it is applied to this Source Code. View the full text of the exception in the file doc/FLOSS-exception.txt in this software distribution, or online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
By copying, modifying or distributing this software, you acknowledge that you have read and understood your obligations described above, and agree to abide by those obligations.
ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, COMPLETENESS OR PERFORMANCE. $/LicenseInfo$
Definition in file pipeline.cpp.
#define IR | ( | x | ) | ((U32&)x) |
A method to compute a ray-AABB intersection. Original code by Andrew Woo, from "Graphics Gems", Academic Press, 1990 Optimized code by Pierre Terdiman, 2000 (~20-30% faster on my Celeron 500) Epsilon value added by Klaus Hartmann. (discarding it saves a few cycles only)
Hence this version is faster as well as more robust than the original one.
Should work provided: 1) the integer representation of 0.0f is 0x00000000 2) the sign bit of the float is the most significant one
Report bugs: p.terdiman@codercorner.com
aabb | [in] the axis-aligned bounding box | |
origin | [in] ray origin | |
dir | [in] ray direction | |
coord | [out] impact coordinates |
Definition at line 3642 of file pipeline.cpp.
Referenced by LLRayAABB().
void apply_cube_face_rotation | ( | U32 | face | ) |
Definition at line 4081 of file pipeline.cpp.
Referenced by LLPipeline::blurReflectionMap(), and LLPipeline::generateReflectionMap().
static F32 calc_light_dist | ( | LLVOVolume * | light, | |
const LLVector3 & | cam_pos, | |||
F32 | max_dist | |||
) | [static] |
Definition at line 3117 of file pipeline.cpp.
References LLDrawable::ACTIVE, fsqrtf, LLVOVolume::getLightIntensity(), LLVOVolume::getLightRadius(), LLViewerObject::getRenderPosition(), LLViewerObject::isSelected(), LLVector3::magVecSquared(), LLViewerObject::mDrawable, and LLPointer< Type >::notNull().
Referenced by LLPipeline::calcNearbyLights().
void forAllDrawables | ( | LLCullResult::sg_list_t::iterator | begin, | |
LLCullResult::sg_list_t::iterator | end, | |||
void(*)(LLDrawable *) | func | |||
) |
Definition at line 1824 of file pipeline.cpp.
Referenced by LLPipeline::forAllVisibleDrawables().
glh::matrix4f gl_ortho | ( | GLfloat | left, | |
GLfloat | right, | |||
GLfloat | bottom, | |||
GLfloat | top, | |||
GLfloat | znear, | |||
GLfloat | zfar | |||
) |
Definition at line 191 of file pipeline.cpp.
Referenced by setup_hud_matrices().
void glh_copy_matrix | ( | const glh::matrix4f & | src, | |
GLdouble * | dst | |||
) |
glh::matrix4f glh_copy_matrix | ( | GLdouble * | src | ) |
Definition at line 153 of file pipeline.cpp.
References i.
Referenced by glh_get_current_modelview(), glh_get_current_projection(), glh_set_current_modelview(), glh_set_current_projection(), and render_ui_and_swap().
glh::matrix4f glh_get_current_modelview | ( | ) |
Definition at line 163 of file pipeline.cpp.
References gGLModelView, and glh_copy_matrix().
Referenced by display(), LLPipeline::generateWaterReflection(), render_hud_attachments(), render_ui_and_swap(), and LLPipeline::renderForSelect().
glh::matrix4f glh_get_current_projection | ( | ) |
Definition at line 168 of file pipeline.cpp.
References gGLProjection, and glh_copy_matrix().
Referenced by display(), LLPipeline::generateWaterReflection(), LLDrawPoolWLSky::render(), LLDrawPoolSky::render(), LLDrawPoolGround::render(), render_hud_attachments(), LLPipeline::renderForSelect(), and LLDrawPoolWater::shade().
void glh_set_current_modelview | ( | const glh::matrix4f & | mat | ) |
Definition at line 181 of file pipeline.cpp.
References gGLModelView, and glh_copy_matrix().
Referenced by display(), LLPipeline::generateImpostor(), LLPipeline::generateWaterReflection(), render_hud_attachments(), render_ui_and_swap(), LLPipeline::renderForSelect(), and setup_hud_matrices().
void glh_set_current_projection | ( | glh::matrix4f & | mat | ) |
Definition at line 186 of file pipeline.cpp.
References gGLProjection, and glh_copy_matrix().
Referenced by display(), LLPipeline::generateImpostor(), render_hud_attachments(), LLPipeline::renderForSelect(), and setup_hud_matrices().
bool LLRayAABB | ( | const LLVector3 & | center, | |
const LLVector3 & | size, | |||
const LLVector3 & | origin, | |||
const LLVector3 & | dir, | |||
LLVector3 & | coord, | |||
F32 | epsilon | |||
) |
Definition at line 3644 of file pipeline.cpp.
References FALSE, i, IR, LLVector3::mV, TRUE, VX, VY, and VZ.
Definition at line 144 of file pipeline.cpp.
References r.
Referenced by LLPipeline::generateImpostor().
void render_cube_map | ( | ) |
Definition at line 4250 of file pipeline.cpp.
References r, and LLVector3::scaledVec().
Referenced by LLPipeline::blurReflectionMap().
void render_hud_elements | ( | ) |
Definition at line 2123 of file pipeline.cpp.
References LLGLImmediate::color4f(), LLPipeline::disableLights(), FALSE, LLGLImmediate::flush(), LLFastTimer::FTM_RENDER_UI, LLSingleton< LLViewerParcelMgr >::getInstance(), LLSingleton< LLWorld >::getInstance(), gForceRenderLandFence, gGL, gViewerWindow, LLPipeline::hasRenderDebugFeatureMask(), LLPipeline::hasRenderType(), LLViewerParcelMgr::render(), LLTracker::render3D(), LLPipeline::RENDER_DEBUG_FEATURE_UI, LLPipeline::RENDER_TYPE_HUD, LLHUDText::renderAllHUD(), LLViewerParcelMgr::renderParcelCollision(), LLWorld::renderPropertyLines(), LLViewerWindow::renderSelections(), and LLPipeline::sReflectionRender.
Referenced by render_hud_attachments(), and render_ui_and_swap().
void render_ui_and_swap_if_needed | ( | ) |
void renderParticleBeacons | ( | LLDrawable * | drawablep | ) |
Definition at line 1920 of file pipeline.cpp.
References LLViewerObjectList::addDebugBeacon(), LLDrawable::getFace(), LLDrawable::getNumFaces(), LLViewerObject::getPositionAgent(), LLControlGroup::getS32(), LLDrawable::getVObj(), gObjectList, gSavedSettings, LLViewerObject::isParticleSource(), LLPipeline::mHighlightFaces, S32, LLPipeline::sRenderBeacons, and LLPipeline::sRenderHighlight.
Referenced by LLPipeline::postSort().
void renderPhysicalBeacons | ( | LLDrawable * | drawablep | ) |
Definition at line 1895 of file pipeline.cpp.
References LLViewerObjectList::addDebugBeacon(), LLDrawable::getFace(), LLDrawable::getNumFaces(), LLViewerObject::getPositionAgent(), LLControlGroup::getS32(), LLDrawable::getVObj(), gObjectList, gSavedSettings, LLPrimitive::isAvatar(), LLPipeline::mHighlightFaces, S32, LLPipeline::sRenderBeacons, LLPipeline::sRenderHighlight, and LLViewerObject::usePhysics().
Referenced by LLPipeline::postSort().
void renderScriptedBeacons | ( | LLDrawable * | drawablep | ) |
Definition at line 1844 of file pipeline.cpp.
References LLViewerObjectList::addDebugBeacon(), LLViewerObject::flagScripted(), LLDrawable::getFace(), LLDrawable::getNumFaces(), LLXform::getParent(), LLViewerObject::getPositionAgent(), LLControlGroup::getS32(), LLDrawable::getVObj(), gObjectList, gSavedSettings, LLPrimitive::isAvatar(), LLPipeline::mHighlightFaces, S32, LLPipeline::sRenderBeacons, and LLPipeline::sRenderHighlight.
Referenced by LLPipeline::postSort().
void renderScriptedTouchBeacons | ( | LLDrawable * | drawablep | ) |
Definition at line 1869 of file pipeline.cpp.
References LLViewerObjectList::addDebugBeacon(), LLViewerObject::flagHandleTouch(), LLViewerObject::flagScripted(), LLDrawable::getFace(), LLDrawable::getNumFaces(), LLXform::getParent(), LLViewerObject::getPositionAgent(), LLControlGroup::getS32(), LLDrawable::getVObj(), gObjectList, gSavedSettings, LLPrimitive::isAvatar(), LLPipeline::mHighlightFaces, S32, LLPipeline::sRenderBeacons, and LLPipeline::sRenderHighlight.
Referenced by LLPipeline::postSort().
void renderSoundHighlights | ( | LLDrawable * | drawablep | ) |
Definition at line 1945 of file pipeline.cpp.
References LLDrawable::getFace(), LLDrawable::getNumFaces(), LLDrawable::getVObj(), LLViewerObject::isAudioSource(), LLPipeline::mHighlightFaces, S32, and LLPipeline::sRenderHighlight.
Referenced by LLPipeline::postSort().
float sgn | ( | float | a | ) | [inline] |
void validate_framebuffer_object | ( | ) |
Definition at line 4294 of file pipeline.cpp.
References llendl, llerrs, and indra::ipc::saranwrap::status().
Referenced by LLPipeline::blurReflectionMap(), and LLPipeline::generateReflectionMap().
const F32 BACKLIGHT_DAY_MAGNITUDE_AVATAR = 0.2f |
Definition at line 113 of file pipeline.cpp.
const F32 BACKLIGHT_DAY_MAGNITUDE_OBJECT = 0.1f |
const F32 BACKLIGHT_NIGHT_MAGNITUDE_AVATAR = 0.1f |
Definition at line 114 of file pipeline.cpp.
const F32 BACKLIGHT_NIGHT_MAGNITUDE_OBJECT = 0.08f |
BOOL gAvatarBacklight = FALSE |
Definition at line 58 of file llgl.cpp.
Referenced by assert_glerror(), LLGLState::checkClientArrays(), LLGLState::checkStates(), LLGLState::checkTextureChannels(), handleRenderDebugGLChanged(), LLPipeline::renderGeom(), LLVertexBuffer::setBuffer(), settings_modify(), and LLGLState::~LLGLState().
BOOL gDebugPipeline = FALSE |
Definition at line 138 of file pipeline.cpp.
Referenced by handleRenderDebugPipelineChanged(), LLPipeline::renderGeom(), and settings_modify().
const LLMatrix4* gGLLastMatrix = NULL |
Definition at line 140 of file pipeline.cpp.
Referenced by LLRenderPass::applyModelMatrix(), LLDrawPoolTree::renderTree(), and LLOctreeRenderNonOccluded::traverse().
Definition at line 108 of file llselectmgr.cpp.
Referenced by init_debug_rendering_menu(), LLVolumeGeometryManager::registerFace(), LLPipeline::renderForSelect(), and LLPipeline::stateSort().
const U32 gl_cube_face[] [static] |
Initial value:
{ GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB, GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB, GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB, GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB, GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB, }
Definition at line 233 of file pipeline.cpp.
Referenced by LLPipeline::blurReflectionMap(), LLPipeline::createGLBuffers(), and LLPipeline::generateReflectionMap().
Definition at line 139 of file pipeline.cpp.
Referenced by LLDrawable::addFace(), LLFrameStats::addFrameData(), LLViewerPartGroup::addPart(), LLViewerWindow::analyzeHit(), LLVOVolume::animateTextures(), LLRenderPass::applyModelMatrix(), LLDrawPoolBump::beginBump(), LLDrawPoolAvatar::beginFootShadow(), LLDrawPoolBump::beginFullbrightShiny(), LLDrawPoolTree::beginRenderPass(), LLDrawPoolAlpha::beginRenderPass(), LLDrawPoolAvatar::beginRigid(), LLDrawPoolBump::beginShiny(), LLDrawPoolAvatar::beginSkinned(), LLAgent::calcFocusPositionTargetGlobal(), LLVOSky::calcSkyColorInDir(), LLVOSky::calcSkyColorWLFrag(), LLDrawable::cleanupReferences(), LLVOWLSky::createDrawable(), LLVOWater::createDrawable(), LLVOVolume::createDrawable(), LLVOSky::createDrawable(), LLVOGround::createDrawable(), LLVOAvatar::createDrawable(), LLVOSky::createDummyVertexBuffer(), LLVOSurfacePatch::dirtyGeom(), LLDrawPoolTerrain::dirtyTextures(), display(), display_startup(), LLVolumeImplFlexible::doIdleUpdate(), LLVOWLSky::drawDome(), LLViewerJointMesh::drawShape(), LLOctreeCull::earlyFail(), LLDrawPoolBump::endBump(), LLDrawPoolAvatar::endFootShadow(), LLDrawPoolBump::endFullbrightShiny(), LLDrawPoolTree::endRenderPass(), LLDrawPoolAlpha::endRenderPass(), LLDrawPoolBump::endShiny(), LLDrawPoolAvatar::endSkinned(), LLViewerWindow::getObjectUnderCursor(), LLVOAvatar::getOffObject(), LLVOSurfacePatch::getPool(), LLDrawable::getSpatialPartition(), LLViewerWindow::handlePerFrameHover(), handleReleaseGLBufferChanged(), handleRenderLightingDetailChanged(), handleRenderUseFBOChanged(), handleRenderUseVBOChanged(), handleResetVertexBuffersChanged(), LLManipTranslate::highlightIntersection(), LLAppViewer::idle(), LLVOTextBubble::idleUpdate(), LLVOGround::idleUpdate(), LLVOGrass::idleUpdate(), LLVOClouds::idleUpdate(), LLVOAvatar::idleUpdate(), LLSky::init(), init_stat_view(), LLAppViewer::initWindow(), LLImagePreviewAvatar::LLImagePreviewAvatar(), LLPreviewAnimation::LLPreviewAnimation(), LLViewerPartGroup::LLViewerPartGroup(), LLShaderMgr::loadBasicShaders(), LLDrawable::makeActive(), LLDrawable::makeStatic(), LLViewerObject::markForUpdate(), LLSpatialBridge::move(), output_statistics(), LLVOVolume::parameterChanged(), LLDrawPoolClouds::prerender(), process_kill_object(), LLOctreeCull::processGroup(), LLSpatialPartition::processImagery(), LLVOVolume::processUpdateMessage(), LLVOGrass::processUpdateMessage(), LLViewerObject::processUpdateMessage(), LLWLParamManager::propagateParameters(), LLWaterParamManager::propagateParameters(), LLDrawPoolBump::pushBatch(), LLRenderPass::pushBatch(), LLRenderPass::pushBatches(), LLFace::pushVertices(), LLViewerWindow::rawSnapshot(), LLManip::rebuild(), LLVolumeGeometryManager::rebuildGeom(), LLFloaterHardwareSettings::refreshEnabledState(), LLViewerObject::removeChild(), LLTexLayerParamAlpha::render(), LLTexLayer::render(), LLImagePreviewSculpted::render(), LLDrawPoolWLSky::render(), LLDrawPoolWater::render(), LLDrawPoolTerrain::render(), LLDrawPoolSky::render(), LLDrawPoolSimple::render(), LLDrawPoolGlow::render(), LLDrawPoolGround::render(), LLDrawPoolClouds::render(), LLDrawPoolInvisible::render(), LLDrawPoolBump::render(), LLDrawPoolAlpha::render(), render_hud_attachments(), render_ui_and_swap(), LLDrawPoolAlpha::renderAlpha(), LLDrawPoolAlpha::renderAlphaHighlight(), LLDrawPoolAvatar::renderAvatars(), LLDrawPoolBump::renderBump(), LLSpatialPartition::renderDebug(), LLDrawPoolBump::renderFullbrightShiny(), LLDrawPoolBump::renderGroup(), LLDrawPoolAlpha::renderGroupAlpha(), LLRenderPass::renderGroups(), LLDrawPoolWLSky::renderHeavenlyBodies(), LLDrawPoolBump::renderShiny(), LLDrawPoolWLSky::renderSkyClouds(), LLDrawPoolWLSky::renderSkyHaze(), LLDrawPoolWLSky::renderStars(), reset_statistics(), LLVOAvatar::resetHUDAttachments(), LLVOWLSky::resetVertexBuffers(), LLSky::resetVertexBuffers(), LLVOWLSky::restoreGL(), LLVOSky::restoreGL(), LLViewerWindow::restoreGL(), LLVOAvatar::restoreMeshData(), LLSelectMgr::selectionMove(), LLSelectMgr::selectionResetRotation(), LLSelectMgr::selectionRotateAroundZ(), LLVOVolume::setDrawableParent(), LLViewerObject::setDrawableParent(), LLVOVolume::setIsLight(), LLVOVolume::setLightColor(), LLViewerObject::setNumTEs(), LLVOVolume::setParent(), LLFace::setPool(), LLViewerObject::setPositionAbsoluteGlobal(), LLVOVolume::setScale(), LLShaderMgr::setShaders(), LLVOVolume::setTEBumpmap(), LLViewerObject::setTEBumpmap(), LLVOVolume::setTEColor(), LLViewerObject::setTEColor(), LLVOVolume::setTEFullbright(), LLViewerObject::setTEFullbright(), LLVOVolume::setTEGlow(), LLViewerObject::setTEGlow(), LLVOVolume::setTEImage(), LLViewerObject::setTEImage(), LLVOVolume::setTEMediaFlags(), LLViewerObject::setTEMediaFlags(), LLViewerObject::setTEOffset(), LLViewerObject::setTEOffsetS(), LLViewerObject::setTEOffsetT(), LLViewerObject::setTERotation(), LLVOVolume::setTEScale(), LLViewerObject::setTEScale(), LLVOVolume::setTEScaleS(), LLViewerObject::setTEScaleS(), LLVOVolume::setTEScaleT(), LLViewerObject::setTEScaleT(), LLVOVolume::setTEShiny(), LLVOVolume::setTETexGen(), LLVOVolume::setTETexture(), LLViewerObject::setTETextureCore(), LLSpatialBridge::setVisible(), LLVOTextBubble::setVolume(), LLDrawPoolWater::shade(), LLVOAvatar::shame(), LLDrawable::shiftPos(), LLVOAvatar::sitOnObject(), LLVOAvatar::slamPosition(), LLViewerWindow::stopGL(), LLFloaterEnvSettings::syncMenu(), LLAgent::teleportCore(), LLViewerWindow::thumbnailSnapshot(), LLOctreeRenderNonOccluded::traverse(), LLShaderMgr::unloadShaders(), LLWLParamManager::update(), LLWaterParamManager::update(), LLDebugText::update(), LLViewerPartSourceScript::update(), LLAgent::updateCamera(), LLVOGrass::updateDrawable(), LLVOClouds::updateDrawable(), LLStaticViewerObject::updateDrawable(), LLViewerObject::updateDrawable(), LLSelectMgr::updateEffects(), LLVOSky::updateFog(), LLVOWater::updateGeometry(), LLVOTextBubble::updateGeometry(), LLVOSky::updateGeometry(), LLVOPartGroup::updateGeometry(), LLVOGround::updateGeometry(), LLVOClouds::updateGeometry(), LLVOAvatar::updateGeometry(), LLViewerImageList::updateImages(), LLVOAvatar::updateImpostors(), LLVOVolume::updateLOD(), LLVOGrass::updateLOD(), LLViewerPartGroup::updateParticles(), LLDrawable::updatePartition(), LLWLParamManager::updateShaderUniforms(), LLViewerPartSim::updateSimulation(), LLVOSky::updateSky(), LLSky::updateSky(), LLVOVolume::updateTEData(), LLDrawable::updateTexture(), LLVOVolume::updateTextures(), LLVOGrass::updateTextures(), LLVOAvatar::updateTextures(), LLWorld::updateWaterObjects(), LLDrawable::updateXform(), LLOctreeRenderNonOccluded::visit(), LLOctreeDirty::visit(), LLOctreeMarkNotCulled::visit(), LLDrawPoolTerrain::~LLDrawPoolTerrain(), and LLViewerWindow::~LLViewerWindow().
BOOL gRenderForSelect = FALSE |
Definition at line 136 of file pipeline.cpp.
Referenced by LLViewerJointMesh::drawShape(), LLViewerJoint::render(), LLViewerParcelMgr::renderCollisionSegments(), LLViewerObjectList::renderObjectsForSelect(), and LLVOAvatar::renderSkinned().
const S32 MAX_ACTIVE_OBJECT_QUIET_FRAMES = 40 |
const S32 MAX_OCCLUDER_COUNT = 2 |
Definition at line 122 of file pipeline.cpp.
const S32 MAX_OFFSCREEN_GEOMETRY_CHANGES_PER_FRAME = 10 |
Definition at line 118 of file pipeline.cpp.
const U32 REFLECTION_MAP_RES = 128 |
Definition at line 119 of file pipeline.cpp.
Referenced by LLPipeline::createGLBuffers(), and LLPipeline::generateReflectionMap().
LLCullResult* sCull = NULL [static] |
Definition at line 231 of file pipeline.cpp.
S32 sDelayedVBOEnable = 0 [static] |
Definition at line 132 of file pipeline.cpp.
Referenced by LLPipeline::destroyGL(), and LLPipeline::updateGeom().