Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 250927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:33:07+00:00 2026-05-11T21:33:07+00:00

I have been having trouble finding straightforward code to render a scene to a

  • 0

I have been having trouble finding straightforward code to render a scene to a texture in OpenGL ES (specifically for the iPhone, if that matters). I am interested in knowing the following:

  1. How do you render a scene to a texture in OpenGL ES?
  2. What parameters must you use to create a texture that is capable of being a render target in OpenGL ES?
  3. Are there any implications with applying this rendered texture to other primitives?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T21:33:07+00:00Added an answer on May 11, 2026 at 9:33 pm

    This is how I’m doing it.

    I define a texture variable (I use Apple’s Texture2D class, but you can use an OpenGL texture id if you want), and a frame buffer:

    Texture2d * texture;
    GLuint textureFrameBuffer;
    

    Then at some point, I create the texture, frame buffer and attach the renderbuffer. This you only need to do it once:

    texture = [[Texture2D alloc] initWithData:0 
                                 pixelFormat:kTexture2DPixelFormat_RGB888
                                 pixelsWide:32
                                 pixelsHigh:32
                                 contentSize:CGSizeMake(width, height)];
    
    // create framebuffer
    glGenFramebuffersOES(1, &textureFrameBuffer);
    glBindFramebufferOES(GL_FRAMEBUFFER_OES, textureFrameBuffer);
    
    // attach renderbuffer
    glFramebufferTexture2DOES(GL_FRAMEBUFFER_OES, GL_COLOR_ATTACHMENT0_OES, GL_TEXTURE_2D, texture.name, 0);
    
    // unbind frame buffer
    glBindFramebufferOES(GL_FRAMEBUFFER_OES, 0);
    

    Every time I want to render to the texture, I do:

    glBindFramebufferOES(GL_FRAMEBUFFER_OES, textureFrameBuffer);
    
    ...
    // GL commands
    ...
    
    glBindFramebufferOES(GL_FRAMEBUFFER_OES, 0);
    

    About your question 3, that’s it, you can use the texture as if it is any other texture.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 154k
  • Answers 154k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Before I start, I must warn you I'm not a… May 12, 2026 at 10:27 am
  • Editorial Team
    Editorial Team added an answer Is it possible that you just changed the zoom on… May 12, 2026 at 10:27 am
  • Editorial Team
    Editorial Team added an answer Please use discussion on mod_wsgi list on Google Groups. I… May 12, 2026 at 10:27 am

Related Questions

I'm creating a rather dirty business connector of my own here, and I'm having
I have a Flex3 project with 2 HorizontalList controls; one of which has drag
My company has acquired several companies lately. We are a Java shop but have
I have the following code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.