Shadow Mapping in Source

Grab your favourite IDE and tinker with the innards of game engines

Re: Fixing env_pojectedtextue(Grain Fixed,Res is now changea

Postby TiiM on Tue Nov 02, 2010 7:54 am

Yes I use the source engine 2007 (such a mistake, I would not do)
Image
Sorry for my English
User avatar
TiiM
Member
Member
 
Joined: Thu Apr 23, 2009 2:31 pm
Location: Slovakia

Re: Fixing env_pojectedtextue(Grain Fixed,Res is now changea

Postby TiiM on Tue Nov 02, 2010 8:28 am

I added the code here and play it no longer works as it should
in file c_basehlplayer.cpp
Code: Select all
void C_BaseHLPlayer::OnDataChanged( DataUpdateType_t updateType )
{
   // Make sure we're thinking
   if ( updateType == DATA_UPDATE_CREATED )
   {
      SetNextClientThink( CLIENT_THINK_ALWAYS );
   }
   ConVarRef scissor( "r_flashlightscissor" );
   scissor.SetValue( "0" );
   BaseClass::OnDataChanged( updateType );
}
Image
Sorry for my English
User avatar
TiiM
Member
Member
 
Joined: Thu Apr 23, 2009 2:31 pm
Location: Slovakia

Re: Fixing env_pojectedtextue(Grain Fixed,Res is now changea

Postby dark0r on Tue Nov 02, 2010 8:45 am

TiiM wrote:I added the code here and play it no longer works as it should
in file c_basehlplayer.cpp
Code: Select all
void C_BaseHLPlayer::OnDataChanged( DataUpdateType_t updateType )
{
   // Make sure we're thinking
   if ( updateType == DATA_UPDATE_CREATED )
   {
      SetNextClientThink( CLIENT_THINK_ALWAYS );
   }
   ConVarRef scissor( "r_flashlightscissor" );
   scissor.SetValue( "0" );
   BaseClass::OnDataChanged( updateType );
}

You're supposed to add it to the constructor:
C_BaseHLPlayer::C_BaseHLPlayer
dark0r
Been Here A While
Been Here A While
 
Joined: Sat Mar 25, 2006 10:16 am
Location: de_hell

Re: Fixing env_pojectedtextue(Grain Fixed,Res is now changea

Postby kkirspel on Tue Nov 02, 2010 12:31 pm

...
Since you are saying you're compiling the code, could you just go ahead and tell me how to in your next post...?
K thks.
The inspiration as to why I'm here: Adam Foster; Minerva. Great job man.
User avatar
kkirspel
Pheropod
Pheropod
 
Joined: Wed Dec 03, 2008 6:34 pm
Location: Columbus, GA, USA

Re: Fixing env_pojectedtextue(Grain Fixed,Res is now changea

Postby -=Biohazard=- on Tue Nov 02, 2010 12:36 pm

kkirspel wrote:...
Since you are saying you're compiling the code, could you just go ahead and tell me how to in your next post...?
K thks.


Take a look there:
http://developer.valvesoftware.com/wiki/My_First_Mod#Prepare_the_solution
User avatar
-=Biohazard=-
Regular
Regular
 
Joined: Mon Apr 07, 2008 11:15 am

Re: Fixing env_pojectedtextue(Grain Fixed,Res is now changea

Postby dark0r on Tue Nov 02, 2010 6:47 pm

kkirspel wrote:...
Since you are saying you're compiling the code, could you just go ahead and tell me how to in your next post...?
K thks.

game/client/hl2/c_basehlplayer.cpp:
Code: Select all
//-----------------------------------------------------------------------------
// Constructor
//-----------------------------------------------------------------------------
C_BaseHLPlayer::C_BaseHLPlayer()
{
   AddVar( &m_Local.m_vecPunchAngle, &m_Local.m_iv_vecPunchAngle, LATCH_SIMULATION_VAR );
   AddVar( &m_Local.m_vecPunchAngleVel, &m_Local.m_iv_vecPunchAngleVel, LATCH_SIMULATION_VAR );

   m_flZoomStart      = 0.0f;
   m_flZoomEnd         = 0.0f;
   m_flZoomRate      = 0.0f;
   m_flZoomStartTime   = 0.0f;
   m_flSpeedMod      = cl_forwardspeed.GetFloat();

   ConVar *r_flashlightscissor = g_pCVar->FindVar("r_flashlightscissor");
   
   if(r_flashlightscissor)
   {
      r_flashlightscissor->AddFlags(FCVAR_HIDDEN | FCVAR_CHEAT);
      r_flashlightscissor->SetValue(0);
   }
}
dark0r
Been Here A While
Been Here A While
 
Joined: Sat Mar 25, 2006 10:16 am
Location: de_hell

Re: Fixing env_pojectedtextue(Grain Fixed,Res is now changea

Postby joe_rogers_11155 on Thu May 26, 2011 10:57 pm

hello guys. first i want to say that these code fixes are monumentally helpful and simply incredible. so thanks :) ok, down to business.

one of the mod teams I am working with recently nabbed a coder. he says he has applied all of the fixes on the VDC regarding projected textures. However, I am slowly but surely encountering a series of errors. I will be posting them here one at a time as I come across them with the hope of getting a nudge in the right direction on how to fix it.

Here's issue #1: all the projected textures are sharing one shadow map.

In these images (one, two, three) both env_projectedtextures are using the shadow map from the entity on the right. The entity on the left has nothing blocking it.

In this image, the flashlight is also using the shadow map from the entity on the right from above.

How to fix? I have been looking over the VDC and I think the answer lies here, "Enabling multiple shadow maps". But my coder says he applied this fix. Not sure what the issue would be...

Any assistance would be appreciated. Again, thanks for all the hard work you have put in across the multiple threads.
"Day breaks, but decay soon follows." - Ava Winona
Currently developing in radio silence... 99 Bolts
Here's another project of mine... Assault on Overwatch
Are you new to Source SDK? VDC
joe_rogers_11155
Veteran
Veteran
 
Joined: Wed Oct 08, 2008 11:11 pm
Location: United States

Re: Fixing env_pojectedtextue(Grain Fixed,Res is now changea

Postby stoopdapoop on Fri May 27, 2011 3:45 am

any way to tell what resolution portal 2 uses?
I'm Brown
Image
User avatar
stoopdapoop
Veteran
Veteran
 
Joined: Sun Aug 21, 2005 2:14 am
Location: Ann Arbor, MI

Re: Fixing env_pojectedtextue(Grain Fixed,Res is now changea

Postby Gary on Fri May 27, 2011 3:54 am

Joe; do you get a "Too many shadowmaps for this frame" error?


Stoop; it appears to use 1024, but for some reason it has greater detail. The real reason Portal 2 shadow mapping looks better is that there is no longer any more shadow bleeding, they likely added better system to handle it.
Have a question related to modding or something I posted? Something that needs staff attention? I haven't been active lately, but feel free to PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: Fixing env_pojectedtextue(Grain Fixed,Res is now changea

Postby joe_rogers_11155 on Fri May 27, 2011 4:17 am

@gary, we figured it out. turns out that i was a massive idiot by working in 2009 hammer instead of 2007 hammer. so derp, none of the changes were being used, lol.

things look much better now. will report back if we have more problems but i think we will be okay.

PS, these projected textures look better than portal 2 in some ways. I think i know what issue you are talking about when it comes to shadow bleeding, and i assume you have already tried your best to resolve the issue in the 2007 code...
"Day breaks, but decay soon follows." - Ava Winona
Currently developing in radio silence... 99 Bolts
Here's another project of mine... Assault on Overwatch
Are you new to Source SDK? VDC
joe_rogers_11155
Veteran
Veteran
 
Joined: Wed Oct 08, 2008 11:11 pm
Location: United States

Re: Fixing env_pojectedtextue(Grain Fixed,Res is now changea

Postby stoopdapoop on Fri May 27, 2011 4:31 am

Gary wrote:Stoop; it appears to use 1024, but for some reason it has greater detail. The real reason Portal 2 shadow mapping looks better is that there is no longer any more shadow bleeding, they likely added better system to handle it.


gotcha.

And wow, I just realized that the thread name is misspelled.
I'm Brown
Image
User avatar
stoopdapoop
Veteran
Veteran
 
Joined: Sun Aug 21, 2005 2:14 am
Location: Ann Arbor, MI

Re: Fixing env_pojectedtextue(Grain Fixed,Res is now changea

Postby Gary on Fri May 27, 2011 4:51 am

stoopdapoop wrote:And wow, I just realized that the thread name is misspelled.



What?

Damnit.
Have a question related to modding or something I posted? Something that needs staff attention? I haven't been active lately, but feel free to PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: Fixing env_pojectedtextue(Grain Fixed,Res is now changea

Postby joe_rogers_11155 on Fri May 27, 2011 5:03 am

Thanks to Gary and crew, my antlions look more epic than ever. (But I just realized I may need to disable regular shadows (RTT)...what do you think?)

Image
Image
Image

woot. Why in the hell doesn't Valve want to do this for their official games? These look almost better than Portal 2.
"Day breaks, but decay soon follows." - Ava Winona
Currently developing in radio silence... 99 Bolts
Here's another project of mine... Assault on Overwatch
Are you new to Source SDK? VDC
joe_rogers_11155
Veteran
Veteran
 
Joined: Wed Oct 08, 2008 11:11 pm
Location: United States

Re: Fixing env_pojectedtextue(Grain Fixed,Res is now changea

Postby Gary on Fri May 27, 2011 7:08 am

joe_rogers_11155 wrote:Thanks to Gary and crew, my antlions look more epic than ever. (But I just realized I may need to disable regular shadows (RTT)...what do you think?)


Looks good, I like your test map. Also what resolution did you make your shadow maps?


joe_rogers_11155 wrote:woot. Why in the hell doesn't Valve want to do this for their official games? These look almost better than Portal 2.


That is a good question, now that Source shadow mapping has seen improvement in Portal 2, I expect to see more of it in their future games. It's just sad how shadow mapping has been in use for years(even all the way back to Halo2 on the original xbox), yet Valve doesn't appear to be invited to the party(till now with Portal2).
Have a question related to modding or something I posted? Something that needs staff attention? I haven't been active lately, but feel free to PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: Fixing env_pojectedtextue(Grain Fixed,Res is now changea

Postby joe_rogers_11155 on Fri May 27, 2011 8:05 am

@gary: I am not sure exactly since I did not actually code it in...but when I look at the chart on the VDC Fixes Page, I am guessing 1024 with a filter of 1. I'll ask our coder about it and get back to you.

Antlion vs Scanner: Battle for Sky Supremacy!!
Image

Purple PT is targeting scanner (following it around). Scanner has a white PT parented to it, angled down 45 degrees. Had to disable the scanner's built-in spotlight since it sweeps left and right while the PT stays pointed forward. Will probably stick a weak point_spotlight on the scanner as well for flair.

Working with a coder is like working with a demigod.
"Day breaks, but decay soon follows." - Ava Winona
Currently developing in radio silence... 99 Bolts
Here's another project of mine... Assault on Overwatch
Are you new to Source SDK? VDC
joe_rogers_11155
Veteran
Veteran
 
Joined: Wed Oct 08, 2008 11:11 pm
Location: United States
PreviousNext

Return to Programming

Who is online

Users browsing this forum: No registered users