summaryrefslogtreecommitdiff
path: root/studiorender/r_studiolight.h
diff options
context:
space:
mode:
Diffstat (limited to 'studiorender/r_studiolight.h')
-rw-r--r--studiorender/r_studiolight.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/studiorender/r_studiolight.h b/studiorender/r_studiolight.h
new file mode 100644
index 0000000..9a984b9
--- /dev/null
+++ b/studiorender/r_studiolight.h
@@ -0,0 +1,49 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: Stateless light computation routines
+//
+//===========================================================================//
+
+#ifndef R_STUDIOLIGHT_H
+#define R_STUDIOLIGHT_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+
+#include "tier0/platform.h"
+
+#if defined( _WIN32 ) && !defined( _X360 )
+#include <xmmintrin.h>
+#endif
+
+
+//-----------------------------------------------------------------------------
+// Forward declarations
+//-----------------------------------------------------------------------------
+class Vector;
+class Vector4D;
+class FourVectors;
+struct lightpos_t;
+struct LightDesc_t;
+
+
+//-----------------------------------------------------------------------------
+// Stateless light computation routines
+//-----------------------------------------------------------------------------
+
+// Computes the ambient term
+void R_LightAmbient_4D( const Vector& normal, Vector4D* pLightBoxColor, Vector &lv );
+void R_LightStrengthWorld( const Vector& vert, int lightcount, LightDesc_t* pLightDesc, lightpos_t *light );
+float FASTCALL R_WorldLightDistanceFalloff( const LightDesc_t *wl, const Vector& delta );
+
+// Copies lighting state into a buffer, returns number of lights copied
+int CopyLocalLightingState( int nMaxLights, LightDesc_t *pDest, int nLightCount, const LightDesc_t *pSrc );
+
+#if defined( _WIN32 ) && !defined( _X360 )
+// SSE optimized versions
+void R_LightAmbient_4D( const FourVectors& normal, Vector4D* pLightBoxColor, FourVectors &lv );
+__m128 FASTCALL R_WorldLightDistanceFalloff( const LightDesc_t *wl, const FourVectors& delta );
+#endif
+
+#endif // R_STUDIOLIGHT_H