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

Hornsj3

Member Since 05 Mar 2012
Offline Last Active Sep 05 2012 03:17 PM
-----

Posts I've Made

In Topic: Deferred rendering tutorials for DirectX 11?

05 August 2012 - 09:52 AM

There's at least one book with an example implementation. Practical Rendering and Computation with DirectX 11.

In Topic: Where can I download the source code of the book "GPU Pro"?

05 August 2012 - 08:53 AM

The author is pretty responsive. I've contacted him in the past.

In Topic: Terrainperformance - round 2

02 August 2012 - 10:47 AM

I'm going to remove this post because I don't think it adds any value.

In Topic: DirectX book

27 July 2012 - 05:07 PM

http://www.crcpress.com/product/isbn/9781568817200

In Topic: Terrain (advanced)

18 July 2012 - 06:52 AM

Another optimization.

I can't remember the syntax exactly but you should probably grab raw memory instead of new chunk[max_chunks]. The reason is calling new chunks[max_chunks] will invoke the chunks constructor max_chunks times. There's no reason to do this and it will slow you down.

I think the solution is this chunk* variableName = static_cast<chunk>(operator new (sizeof(chunk) * max_chunks));

The difference is when you say "operator new" and specify an amount of memory it will just reserve raw memory and therefore not construct your objects.

All other aforementioned rules apply.


edit -

When doing this please note you have to keep track of how many constructed objects you have and where they are in the buffer because as I mentioned those objects will not exist until placed. Using raw memory when you expect to have a constructed object would not have the effect you intend =D.

PARTNERS