[HOpenGL] GPipe: Binding textures to geometry

Tobias Bexelius tobias_bexelius at hotmail.com
Sat Mar 6 13:21:34 EST 2010


I'm guessing you're trying to have different pictures on each side of the example cube? You could use a Texture3D and have an extra depth component for each uv-coordinate. But you could also pair up each side with a separate texture as your doing now, and it will still only use one shader (but different sampler uniforms). For best performance however, you should put all six sides in a single 2D image and reference into this "texture-atlas".

 

About performance, I'll release a new version in a week or so that will increase the performance for the example and most other usage scenarios.

 

The matrix multiplications are done on the CPU intentionally since its an operation on constant values.

 

Cheers

Tobias

 

 
> To: hopengl at haskell.org
> From: barsoap at web.de
> Date: Thu, 25 Feb 2010 23:15:15 +0100
> Subject: [HOpenGL] GPipe: Binding textures to geometry
> 
> I'm by no means an GL expert, but I think it should be possible to
> attach a texture index to vertices, so that only one fragment shader is
> needed instead of one for every texture. Currently, I'm duplicating the
> whole graphics pipeline for virtually every triangle, and it seems that
> is what's killing performance.
> 
> 
> Random minor nitpick: The matrix multiplications in the example are done
> on the CPU, not GPU.
> 
> -- 
> (c) this sig last receiving data processing entity. Inspect headers
> for copyright history. All rights reserved. Copying, hiring, renting,
> performance and/or quoting of this signature prohibited.
> 
> 
> _______________________________________________
> HOpenGL mailing list
> HOpenGL at haskell.org
> http://www.haskell.org/mailman/listinfo/hopengl
 		 	   		  
_________________________________________________________________
Klicka här!
http://new.windowslivemobile.msn.com/SE-SE/windows-live-hotmail/default.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/hopengl/attachments/20100306/7c154ca3/attachment.html


More information about the HOpenGL mailing list