Jump to content

  • Log In with Google      Sign In   
  • Create Account

FrameBuffer Heightmaps Poor Performance


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 multifractal   Members   -  Reputation: 229

Like
0Likes
Like

Posted 06 October 2013 - 07:41 PM

Hello, 

I have been trying to render height maps to a texture using a frame buffer object. This works...although the performance is simply awful (3 fps). I think the problem rests in the fact the that the quad is still attached to the viewport after the terrain is rendered yet calling viewPort.detach(quad) results in the following, distorted image: 

 

Screen_Shot_2013_10_06_at_9_38_29_PM.png

 

 

 

Here is the code I use to create the frame buffer, attach it to a viewport, and render the height map to a texture. The shader is running improved, texture-based, perlin noise. 

                Texture2D hm = new Texture2D(1024,1024,Format.RGBA32F);	
		Quad quad = new Quad(2,2);
		mat = new Material(assetManager, "NoiseProgram.j3md"); 
		geom = new Geometry("Quad",quad);
		geom.setMaterial(mat);
		mat.setTexture("permSampler2d", permutationTexture());
		mat.setTexture("permGradSampler", gradientTexture());
		FrameBuffer fbo = new FrameBuffer(1024,1024,1);
		fbo.setColorTexture(hm);
		vp.setOutputFrameBuffer(fbo);
		vp.attachScene(ge);

I may have not done a great job explaining the problem. Thanks for any help. 



Sponsor:

#2 Seabolt   Members   -  Reputation: 633

Like
0Likes
Like

Posted 07 October 2013 - 04:05 PM

Sir, optimization without finding the bottleneck is pushishable by death.

Take a look at Pix to see where the majority of your frame count is going, take a look at what warnings may be displayed, try cutting out parts of the algorithm and see what gives you the biggest frame boost; but do not ever, **EVER**, guess. I say this from experience. You always eliminate the bottleneck first.

That being said, what does rendering the height map entail? And you say the quad may still be attached, what do you mean? Your fullscreen quad that you used to rasterize the screen with? Because if that's still drawing then you'll definitely take a hit.


Perception is when one imagination clashes with another

#3 BornToCode   Members   -  Reputation: 948

Like
0Likes
Like

Posted 07 October 2013 - 11:27 PM

Sir, optimization without finding the bottleneck is pushishable by death.

Take a look at Pix to see where the majority of your frame count is going, take a look at what warnings may be displayed, try cutting out parts of the algorithm and see what gives you the biggest frame boost; but do not ever, **EVER**, guess. I say this from experience. You always eliminate the bottleneck first.

That being said, what does rendering the height map entail? And you say the quad may still be attached, what do you mean? Your fullscreen quad that you used to rasterize the screen with? Because if that's still drawing then you'll definitely take a hit.

It looks like he is using OpenGL and not DirectX. So pix will not work in that case. You can use gDebugger for OpenGL. here is a link to where you can download it.

http://www.gremedy.com/



#4 Seabolt   Members   -  Reputation: 633

Like
0Likes
Like

Posted 08 October 2013 - 10:18 AM

Doh! Sorry I thought I was still in the DX forum, I apologize for that OP. 


Perception is when one imagination clashes with another




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS