Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualreaperrar

Posted 22 January 2013 - 08:17 PM

Trying to set up a class which renders text to a texture (specifically in 2D). I have text rendering atm but obviously if the string never changes I could save on performance a lot by rendering the static text into a single texture.

 

I got it working to some degree, though I have another post about that issue which I think is unrelated to this post...

http://www.gamedev.net/topic/637666-render-target-alpha-blending/

 

I'm posting this to ask if these are the normal steps you would take to acheive this:

  1. Disable depth & stencil testing (2D)
  2. Enable alpha blending
  3. Set up projection to accomodate text block dimensions
  4. Set up render target texture2D to accomodate text block dimensions
  5. Set up viewport to accomodate text block dimensions
  6. EDIT: Clear render target (forgot to mention that, ty L.Spiro for reminding me)
  7. Render text into texture
  8. Set back to default projection, view port and render target

One thing I forgot when following these steps was that textures dimensions are supposed to a power of 2. Though it appeared to render undistorted (text block dimensions were not a power of 2 or even close).


#1reaperrar

Posted 22 January 2013 - 05:58 PM

Trying to set up a class which renders text to a texture (specifically in 2D). I have text rendering atm but obviously if the string never changes I could save on performance a lot by rendering the static text into a single texture.

 

I got it working to some degree, though I have another post about that issue which I think is unrelated to this post...

http://www.gamedev.net/topic/637666-render-target-alpha-blending/

 

I'm posting this to ask if these are the normal steps you would take to acheive this:

  1. Disable depth & stencil testing (2D)
  2. Enable alpha blending
  3. Set up projection to accomodate text block dimensions
  4. Set up render target texture2D to accomodate text block dimensions
  5. Set up viewport to accomodate text block dimensions
  6. Render text into texture
  7. Set back to default projection, view port and render target

One thing I forgot when following these steps was that textures dimensions are supposed to a power of 2. Though it appeared to render undistorted (text block dimensions were not a power of 2 or even close).


PARTNERS