Strange Sprite Errors

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

Strange Sprite Errors

Postby city14 on Sun Jun 27, 2010 11:12 pm

Alright, I am getting some messed up sprites in my mod.

I'm running hl2mp on the OB engine. And I have added a couple of code snippets from the VDC.

The sprites seem to be flickering on and off constantly. And depending on whether I am looking at it or not it also creates some strange errors. Here's a youtube video:



I put this in the coding subsection just to see if someone can come up with a reason why this isn't working.

Here are the two things that I have implemented in my code:
Dynamic Scopes for the Crossbow
Ironsighting on Weapons

I would fear that the crossbow is the most likely culprit, as it modified the actual render code.

Also, I was getting some strange errors until I commented out a line about portal...

c_pixel_visibility.cpp (413)
Code: Select all
#ifndef PORTAL // FIXME: comment too long!
   //Assert(m_frameIssued != gpGlobals->framecount);      This I commented out.
#endif


I have ran it in another single player OB engine mod without these code tweaks and it runs fine... I have no idea how it compares though, because this is my first MP mod I have ever coded in.
Also, when I start the map, right after "redownloaded all lightmaps" in the console, I get about 5 lines of:
Code: Select all
blocking issue in occlusion queries! Grab brian!


Alright, hope someone can help me, anyone, with any ideas...
coder0xff wrote:I wonder if Gabe ever lies in bed at night, thinking about all the fat jokes, and just cries himself to sleep, wiping his tears away with one-thousand dollar bills.
User avatar
city14
Pheropod
Pheropod
 
Joined: Tue Jun 16, 2009 8:35 pm
Location: Troutdale, Oregon

Re: Strange Sprite Errors

Postby cpl. punishment on Sun Jun 27, 2010 11:46 pm

What render mode are you using for the sprites? Try switching to World Space Glow if it isn't already.
cpl. punishment
Been Here A While
Been Here A While
 
Joined: Thu Oct 04, 2007 10:48 pm

Re: Strange Sprite Errors

Postby city14 on Sun Jun 27, 2010 11:48 pm

More information!

Well, good thing I put this into the coding section, now I know this is all on the coding side.

I saw through my crossbow's scope that the sprites were working, so I turned off the crossbow's render function, and the problem disappeared.

Image

Well, if anyone knows why the sprites are affected so heavily by this piece of code...
coder0xff wrote:I wonder if Gabe ever lies in bed at night, thinking about all the fat jokes, and just cries himself to sleep, wiping his tears away with one-thousand dollar bills.
User avatar
city14
Pheropod
Pheropod
 
Joined: Tue Jun 16, 2009 8:35 pm
Location: Troutdale, Oregon

Re: Strange Sprite Errors

Postby city14 on Mon Jun 28, 2010 1:17 am

Alright, just to show you how it works I added a convar to switch the scope on or off.

Here's the video:
coder0xff wrote:I wonder if Gabe ever lies in bed at night, thinking about all the fat jokes, and just cries himself to sleep, wiping his tears away with one-thousand dollar bills.
User avatar
city14
Pheropod
Pheropod
 
Joined: Tue Jun 16, 2009 8:35 pm
Location: Troutdale, Oregon

Re: Strange Sprite Errors

Postby city14 on Mon Jun 28, 2010 2:52 am

AHA! I have fixed it. Totally doesn't benefit anyone else though I guess... I mean, no one but cpl. punishment tried to help me. But, whatever.

Here's the fix.

Code: Select all
bool bDrew3dSkybox = false;   // bDrew3dSkybox = true turns the skybox OFF. DO NOT SET IT TO TRUE.
   SkyboxVisibility_t nSkyboxVisible = SKYBOX_3DSKYBOX_VISIBLE;
 
   //Set the view up and output the scene to our RenderTarget (Scope Material).
   render->Push3DView( scopeView, VIEW_CLEAR_DEPTH | VIEW_CLEAR_COLOR, pRenderTarget, GetFrustum() );
   ViewDrawScene( bDrew3dSkybox, nSkyboxVisible, scopeView, VIEW_CLEAR_DEPTH, VIEW_MAIN, VIEW_MONITOR );


Code: Select all
bool bDrew3dSkybox = false;   // bDrew3dSkybox = true turns the skybox OFF. DO NOT SET IT TO TRUE.
   SkyboxVisibility_t nSkyboxVisible = SKYBOX_3DSKYBOX_VISIBLE;
 
   //Set the view up and output the scene to our RenderTarget (Scope Material).
   render->Push3DView( scopeView, VIEW_CLEAR_DEPTH | VIEW_CLEAR_COLOR, pRenderTarget, GetFrustum() );
   ViewDrawScene( bDrew3dSkybox, nSkyboxVisible, scopeView, 0, VIEW_MONITOR);


Changed the last line, removing the VIEW_MAIN reference. All good now!
coder0xff wrote:I wonder if Gabe ever lies in bed at night, thinking about all the fat jokes, and just cries himself to sleep, wiping his tears away with one-thousand dollar bills.
User avatar
city14
Pheropod
Pheropod
 
Joined: Tue Jun 16, 2009 8:35 pm
Location: Troutdale, Oregon

Re: Strange Sprite Errors

Postby TickingHands on Mon Jun 28, 2010 3:50 am

I actually might want to do something like what you were doing, so thanks for the solution.
Most people just leave saying "I fixed it!", but you put the code too. Thanks.
Glad you fixed the problem.
TickingHands
Member
Member
 
Joined: Thu Nov 19, 2009 1:56 am

Return to Programming

Who is online

Users browsing this forum: No registered users

cron