diff --git a/build/demos/levels/transparent/transparent.ent b/build/demos/levels/transparent/transparent.ent index 836f081b3070ce11c2b614a57fdd23c0d0a71fc2..114cc71663f75def3e6ef20d8201a9bc3cb0cca0 100644 --- a/build/demos/levels/transparent/transparent.ent +++ b/build/demos/levels/transparent/transparent.ent @@ -23,8 +23,36 @@ flags = 0 classname = prop_static auto_physbox = 1 -[meta] -count = 10 +[ent_10] +type_shadow = 1 +shadow_intensity = 1.000000 +rotation = 0.229104 0.124787 -0.290361 0.920668 +parent = +origin = -16.763458 11.002231 1.500001 +name = +linked_to = +flags = 0 +dist = 10.000000 +color = 2.000000 1.500000 1.000000 +classname = light_sun +OnTurnOn = +OnTurnOff = + +[ent_11] +use_trimesh = 0 +skin = 0 +scale = 1.000000 +rotation = 0.000000 0.000000 0.000000 1.000000 +parent = +origin = -21.840677 0.000000 -16.020668 +name = +model = meshes/box/box_mtl_lit.dse +is_static = 1 +glow_color_ref = +glow_color = 0.000000 0.000000 0.000000 +flags = 0 +classname = prop_static +auto_physbox = 1 [ent_2] use_trimesh = 0 @@ -153,3 +181,6 @@ glow_color = 0.000000 0.000000 0.000000 flags = 0 classname = prop_static auto_physbox = 1 + +[meta] +count = 12 diff --git a/build/demos/levels/transparent/transparent.lvl b/build/demos/levels/transparent/transparent.lvl index 1a2fb3af148e5a835b38cf6d03d543914d6a51ca..cc4917528431cf49652beba776513271eb88f4b9 100644 --- a/build/demos/levels/transparent/transparent.lvl +++ b/build/demos/levels/transparent/transparent.lvl @@ -7,18 +7,18 @@ vp_layout = 0 grid_step = 6 grid_show = 1 cam3_view = 1 -cam3_scale = 0.017939 -cam3_pos = -5.900388 -2.482251 -1000.000000 +cam3_scale = 0.034337 +cam3_pos = -19.339674 0.913420 -1000.000000 cam3_dir = -0.000000 -0.000000 -0.000000 cam2_view = 2 -cam2_scale = 0.068271 -cam2_pos = 1000.000000 -0.134729 -14.557329 +cam2_scale = 1.000000 +cam2_pos = 1000.000000 0.000000 0.000000 cam2_dir = 0.000000 1.#QNAN0 0.000000 cam1_view = 0 -cam1_scale = 0.304896 -cam1_pos = -26.377651 1000.000000 2.464243 +cam1_scale = 0.088629 +cam1_pos = -17.542152 1000.000000 -18.546606 cam1_dir = -1.570796 -0.000000 0.000000 cam0_view = -1 cam0_scale = 1.000000 -cam0_pos = 2.478239 10.869446 -34.316093 -cam0_dir = -0.169332 -0.145141 -0.000000 +cam0_pos = -20.482624 1.982736 -19.983189 +cam0_dir = -0.297195 -0.266095 0.000000 diff --git a/build/demos/materials/box/box_mtl_lit.mtl b/build/demos/materials/box/box_mtl_lit.mtl new file mode 100644 index 0000000000000000000000000000000000000000..1c36ab49f5b7224988395d04eb8a57aa7c0bd314 --- /dev/null +++ b/build/demos/materials/box/box_mtl_lit.mtl @@ -0,0 +1,6 @@ +[axe_Metallic] +shader = Default +tex.txBase = mtl_box_big.dds +flag.emissive = 1 +tex.txEmissive = box_mtl_lit.dds +prop.em_multiplier = 1.0f diff --git a/build/demos/meshes/box/box_mtl_lit.dse b/build/demos/meshes/box/box_mtl_lit.dse new file mode 100644 index 0000000000000000000000000000000000000000..b28675cddc17a8267ea4cace07c6f6f8d0e46827 Binary files /dev/null and b/build/demos/meshes/box/box_mtl_lit.dse differ diff --git a/build/demos/textures/box/box_mtl_lit.dds b/build/demos/textures/box/box_mtl_lit.dds new file mode 100644 index 0000000000000000000000000000000000000000..d3be4e2f155ce949679f26e37bb41f65a9cdf72a Binary files /dev/null and b/build/demos/textures/box/box_mtl_lit.dds differ diff --git a/build/demos/textures/box/box_mtl_lit.psd b/build/demos/textures/box/box_mtl_lit.psd new file mode 100644 index 0000000000000000000000000000000000000000..d7294d94f8a46879cfa818d2063bead2aebd89d8 Binary files /dev/null and b/build/demos/textures/box/box_mtl_lit.psd differ diff --git a/build/demos/textures/mtl/mtl_box_big.dds b/build/demos/textures/mtl/mtl_box_big.dds new file mode 100644 index 0000000000000000000000000000000000000000..49909077e9b815cd852fce889a0132e513a051c3 Binary files /dev/null and b/build/demos/textures/mtl/mtl_box_big.dds differ diff --git a/proj/sxgame/vs2013/sxgame.vcxproj b/proj/sxgame/vs2013/sxgame.vcxproj index 722e66f157103daf6ad7a531422962717b524acd..ae432b14f6fbd395c17c98a1d2ccfb112dcebddf 100644 --- a/proj/sxgame/vs2013/sxgame.vcxproj +++ b/proj/sxgame/vs2013/sxgame.vcxproj @@ -200,6 +200,7 @@ <ClCompile Include="..\..\..\source\game\HUDcontroller.cpp" /> <ClCompile Include="..\..\..\source\game\LightDirectional.cpp" /> <ClCompile Include="..\..\..\source\game\LightPoint.cpp" /> + <ClCompile Include="..\..\..\source\game\LightSun.cpp" /> <ClCompile Include="..\..\..\source\game\LogicRelay.cpp" /> <ClCompile Include="..\..\..\source\game\NPCBase.cpp" /> <ClCompile Include="..\..\..\source\game\NPCZombie.cpp" /> @@ -255,6 +256,7 @@ <ClInclude Include="..\..\..\source\game\GameStates.h" /> <ClInclude Include="..\..\..\source\game\HUDcontroller.h" /> <ClInclude Include="..\..\..\source\game\IGameState.h" /> + <ClInclude Include="..\..\..\source\game\LightSun.h" /> <ClInclude Include="..\..\..\source\game\LogicRelay.h" /> <ClInclude Include="..\..\..\source\game\PropBreakable.h" /> <ClInclude Include="..\..\..\source\game\PropButton.h" /> diff --git a/proj/sxgame/vs2013/sxgame.vcxproj.filters b/proj/sxgame/vs2013/sxgame.vcxproj.filters index 18e2bc35faeec45c1118b93de571a5ec3eb86c9e..5a7037f354d6ebb18f83e881e5fc4c0b970a22dd 100644 --- a/proj/sxgame/vs2013/sxgame.vcxproj.filters +++ b/proj/sxgame/vs2013/sxgame.vcxproj.filters @@ -246,6 +246,9 @@ <ClCompile Include="..\..\..\source\game\TriggerHurt.cpp"> <Filter>Source Files\ents\triggers</Filter> </ClCompile> + <ClCompile Include="..\..\..\source\game\LightSun.cpp"> + <Filter>Source Files\ents\light</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\..\..\source\game\sxgame.h"> @@ -428,5 +431,8 @@ <ClInclude Include="..\..\..\source\game\TriggerHurt.h"> <Filter>Header Files\ents\triggers</Filter> </ClInclude> + <ClInclude Include="..\..\..\source\game\LightSun.h"> + <Filter>Header Files\ents\light</Filter> + </ClInclude> </ItemGroup> </Project> \ No newline at end of file diff --git a/source/game/LightDirectional.h b/source/game/LightDirectional.h index 2f1949b6ce15294f5f968c53dd952d291074c490..ba49edf9c54b301377216495d931f3c5d40dc660 100644 --- a/source/game/LightDirectional.h +++ b/source/game/LightDirectional.h @@ -46,7 +46,7 @@ public: float getRadiusTop() const { return m_fRadiusTop; }; protected: - void onSync(); + void onSync() override; float m_fOuterAngle = SM_PI * 0.4f; float m_fInnerAngle = SM_PI * 0.4f * 0.7f; diff --git a/source/game/LightSun.cpp b/source/game/LightSun.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8bbc861a844759183a1bb1aa95df57019f6d343a --- /dev/null +++ b/source/game/LightSun.cpp @@ -0,0 +1,42 @@ + +/*********************************************************** +Copyright © Vitaliy Buturlin, Evgeny Danilovich, 2017, 2018 +See the license in LICENSE +***********************************************************/ + +#include "LightSun.h" + +/*! \skydocent light_sun +Солнце +*/ + +BEGIN_PROPTABLE(CLightSun) + // empty +END_PROPTABLE() + +REGISTER_ENTITY(CLightSun, light_sun); + +CLightSun::CLightSun(CEntityManager * pMgr):BaseClass(pMgr) +{ + if(m_pLightSystem) + { + m_pLight = m_pSun = m_pLightSystem->newSun(); + //m_pLight->setDistance(m_fDist); + m_pLight->setColor(float4(m_vColor, m_fDist)); + } +} + +CLightSun::~CLightSun() +{ + mem_release(m_pLight); +} + +void CLightSun::onSync() +{ + BaseClass::onSync(); + + if(m_pSun) + { + m_pSun->setDirection(m_vOrientation); + } +} diff --git a/source/game/LightSun.h b/source/game/LightSun.h new file mode 100644 index 0000000000000000000000000000000000000000..08f933975d23dc475c2d4eddb0dd1f79cab97216 --- /dev/null +++ b/source/game/LightSun.h @@ -0,0 +1,33 @@ + +/*********************************************************** +Copyright © Vitaliy Buturlin, Evgeny Danilovich, 2017, 2018 +See the license in LICENSE +***********************************************************/ + +/*! +\file +Солнце +*/ + +#ifndef __LIGHTSUN_H +#define __LIGHTSUN_H + +#include "BaseLight.h" + +/*! Солнце +\ingroup clight +*/ +class CLightSun: public CBaseLight +{ + DECLARE_CLASS(CLightSun, CBaseLight); + DECLARE_PROPTABLE(); +public: + DECLARE_CONSTRUCTOR(); + ~CLightSun(); + +protected: + void onSync() override; + IXLightSun *m_pSun = NULL; +}; + +#endif diff --git a/source/light/ShadowCache.h b/source/light/ShadowCache.h index 757b73c4e9fea9dd42e6e2ab941e3125f67f3b0b..3efd3f56e58e5ef852d0baf8957cc0d819dff76d 100644 --- a/source/light/ShadowCache.h +++ b/source/light/ShadowCache.h @@ -121,6 +121,7 @@ protected: { private: IXRenderPipeline *m_pRenderPipeline; + //! @fixme this should be properly aligned! Array<T> m_aMaps; Array<T*> m_aMapsQueue; LIGHT_RENDER_TYPE m_renderType;