Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 08 Mar 2012
Offline Last Active Apr 27 2015 04:01 PM

Posts I've Made

In Topic: Vertex Normals In A QuadTree Terrain

18 October 2013 - 09:31 AM

I think you assume, that I have a global heightmap.

I forgot to say that I this is procedural terrain. The heightdata is generated per Node on the GPU, so no global heightmap data.


Someone might say "Then make the heightmap one pixel larger in every direction" - That dosen"t work either. When the node is on the edge of the cube, I would have to make a 3D heightmap, what would require to know the different side while creating the heightmap and increases the memory consumption by at least 3 times.

In Topic: GLFW 3 GetCursorPos() only zero

12 July 2013 - 04:42 AM

I already suspected this when I saw the doc example using doubles and I am using int. Yes the "out" Parameters are call-by-reference in C#.


Thanks for your help happy.png I will open a issue on Pencil.Gaming

In Topic: Slowdowns / 'Anti-Hotspot'

29 September 2012 - 08:12 AM

There's always a reason. For C#, that reason is usually the garbage collector.

Can I avoid this problem by creating nodes in a new thread?

What you need to diagnose the issues is a profiler.

Mh... I don't think this is what I need. It's not that I don't understand which parts of code lines are slow, I don't know why the are getting slow by random.

In Topic: Initialize variables out of a loop?

29 April 2012 - 06:01 PM


Remember, if it is a trivial and safe transformation, the compiler writers will probably have already implemented it.

I don't count on that since I've read that this:

int length = List.Count
for (int i = 0; i < length; i++
	//Run through list

is several times faster than

for (int i = 0; i < List.Count; i++
	//Run through list

One line of code optimization.

Finally, are you sure you need all these variables? For optimisation, the fastest code is the code that doesn't have to run. Perhaps some of these values are actually redundant.

It generates a planet chunk with curvature, trianglelist, heighmap and textures coordinates at once. Yes I need that many variables Posted Image

But thanks for all your answers. Now I'm able to clean up my code a bit :)

In Topic: Texture artifacts

10 April 2012 - 06:58 AM

No, its definatly not z-fighting caused by two chunks. It seems that the texture wrapping runs out of precision.

The values on the screenshot are the near /far- planes of the chunks. I calculate it on how close I'm to the surface, because the accuracy gets lost when i take 0.0000001 to 10000. The closer I get to the surface the smaller are the values for the planes.