Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Trying to get player to cast shadows from projected textures in first person except from flashlight.
- // Test map for sdk: https://dl.dropboxusercontent.com/u/1910689/projectedhack.bsp
- //0:28 - Rama: sooo you want localplayer to cast a shadow from his own flashlight?
- //0:35 - Python1320: the other way around
- //0:35 - Python1320: everything but flashlight
- // this lets the model draw in shadows regardless of anything
- int C_BasePlayer::DrawModel( int flags )
- {
- if ((flags & STUDIO_RENDER) && (flags & STUDIO_SHADOWDEPTHTEXTURE)) {
- return BaseClass::DrawModel(flags);
- }
- // this I hoped would let us add a way to choose whether to draw local player in the projected texture or not
- void C_EnvProjectedTexture::UpdateLight( bool bForceUpdate )
- FlashlightState_t state;
- state.m_bAlwaysDrawLocalPlayer = true;
- // this is something I hoped would carry the flag to another structure that we can actually see in CShadowDepthView
- void CClientShadowMgr::ComputeShadowDepthTextures( const CViewSetup &viewSetup )
- {
- // flashlightState.m_bAlwaysDrawLocalPlayer is false here, WHYYY????
- shadowView.m_bAlwaysDrawLocalPlayer = flashlightState.m_bAlwaysDrawLocalPlayer;
- // this is what actually does the depth drawing for shadows, let's inject player here
- // remove the if (m_bAlwaysDrawLocalPlayer) to test the awesomeness
- void CShadowDepthView::Draw()
- //AFTER DrawOpaqueRenderables( DEPTH_MODE_SHADOW ); ADD
- if (m_bAlwaysDrawLocalPlayer) {
- C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer();
- if (pPlayer) {
- DrawOpaqueRenderable(pPlayer, false, DEPTH_MODE_SHADOW, 0);
- //todo: wepoon right when I get at least player to work
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment