Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Josh Klint

Member Since 09 Jan 2011
Offline Last Active Yesterday, 04:32 PM
-----

Topics I've Started

Coding Gouraud or Phong shading on a polygon

14 May 2013 - 03:41 PM

I'm implementing smooth groups for our lightmapper.  This means each face's normal needs to be interpolated across a face for the lighting equation, instead of just using the flat polygon normal.

 

Our lightmapper works on BSP-style, where each side is coplanar and can have any number of sides.

 

So my question is, is there a simple way to do Gouraud or Phong shading on a coplanar polygon?  Is there any other routine that can calculate this?  I tried messing around with a vertex distance method, but I don't think that will work.


Remove any items from a list while iterating

03 May 2013 - 09:56 PM

Has anyone found a way to remove any item from a list as it is iterating?

Normally a loop to iterate through a linked list looks like this:

for ( it = list.begin(); it != list.end(); it++ )
{
}

 

 

If you want to be able to remove an item from the list while it is iterating, you can always do this:

it = list.begin();
while (it != list.end() )
{
	if (condition)
	{
		it = list.erase(it);
	}
	else
	{
		it++;
	}
}

 

 

But what if the code in your loop called other code that could result in the removal of the object from the list, with no way to tell it occurred? It could also result in removing other objects from the list, with no way of knowing it happened. In that case, our previous trick would not be enough to prevent any possible problems, because the code might be removing the next item in the list after we have forwarded the iterator.

Has anyone come up with a solution to this?


Deferred Renderer on iPad

20 March 2013 - 11:29 AM

I wanted to see what would happen if I tried to put some of our advanced rendering code on the iPad.  It turns out it actually runs, at 60 FPS:

NVidia Tegra 4

07 January 2013 - 06:30 PM

NVidia's Tegra 4 processor has 72 graphics cores. I can make a full deferred renderer with this: http://nvidianews.nvidia.com/Releases/NVIDIA-Introduces-World-s-Fastest-Mobile-Processor-8ed.aspx

 

Come to the GDC and see my talk about it!  I should have something cool to show by then, if I can get my hands on one of these things.

 

http://www.leadwerks.com


Making a launched process window on top?

11 October 2012 - 05:07 PM

I am using freeprocess to launch and communicate with an external EXE, but the launched window won't activate/become foreground, on top of main program window.
My launched process has window activation code like below, but it doesn't work when the process is launched from my main application:
void Window::Activate()
{
  BringWindowToTop(hwnd);
  SetWindowPos(hwnd,NULL,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE);
  SetForegroundWindow(hwnd);
  SetActiveWindow(hwnd);
  SetFocus(hwnd);
  current = this;
}
My main application also calls AllowSetForegroundWindow(), to try to give the launched process permission to take the foreground, but it doesn't seem to do anything:
  process=CreateProcess("~q"+procpath+"~q "+parameters)
?win32
  AllowSetForegroundWindow(process.handle)
?
How can I allow the window of my launched process to become the topmost window?

PARTNERS