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

  • Home
  • SEARCH
  • 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 8556849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:26:47+00:00 2026-06-11T15:26:47+00:00

I need to render an OpenGL scene to a texture in order to then

  • 0

I need to render an OpenGL scene to a texture in order to then manipulate that texture in a shader. I’ve solved this by using Framebuffer Objects, which I think I understand fairly well by now. At many points in my effect pipeline, I need to render a fullscreen quad and texture it with the dynamically rendered texture, which is where my problem is.

This is what my scene looks like: https://www.mathematik.uni-marburg.de/~thomak/planet.jpg

I render this to a texture and map that texture to a fullscreen quad. However, the resulting image is distorted in this way: https://www.mathematik.uni-marburg.de/~thomak/planettexture.jpg

Here is the code that renders the quad and sets the texture coordinates:

glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glBegin(GL_QUADS);

glTexCoord2i(0, 0);
glVertex3i(-1, -1, -1);    
glTexCoord2i(0, 1);
glVertex3i( 1, -1, -1); 
glTexCoord2i(1, 1);   
glVertex3i( 1,  1, -1); 
glTexCoord2i(1, 0);   
glVertex3i(-1,  1, -1);

glEnd();
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glPopMatrix();

And the shader code is here:

sampler2D BlitSamp = sampler_state
{
  MinFilter = LINEAR;
  MagFilter = LINEAR;
  MipFilter = LINEAR;
  AddressU = Clamp;
  AddressV = Clamp;
};

float4 AlphaClearPS(float2 texcoords : TEXCOORD0) : COLOR
{
  return float4(tex2D(BlitSamp, texcoords).rgb, 1.0f);
}

Where BlitSamp is the texture I rendered to and then passed to the shader. What could be going on here?

  • 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-06-11T15:26:48+00:00Added an answer on June 11, 2026 at 3:26 pm

    It’s possible that your tex-coords are off. Your code, my comments:

    glTexCoord2i(0, 0);     //Bottom-Left
    glVertex3i(-1, -1, -1); //Bottom-Left    
    
    glTexCoord2i(0, 1);     //Top-Left
    glVertex3i( 1, -1, -1); //Bottom-Right??? 
    
    glTexCoord2i(1, 1);     //Top-Right
    glVertex3i( 1,  1, -1); //Top-Right
    
    glTexCoord2i(1, 0);     //Bottom-Right
    glVertex3i(-1,  1, -1); //Bottom-Left??
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to render quite alot (tens of thousands) images off-screen using OpenGL. I
I need to initialize an OpenGL 2D texture with zeroes. Why? I render to
I am using OpenGL to render a model of an object that is rotationally-symmetric
I'm using Backbone.Marionette and need to render a view of employees and their respective
Let's just say that I need to render a certain amount of HTML over
I need to render a simple texture mapped model as the output of a
I'm learning about how to use JOGL and OpenGL to render texture-mapped quads. I
I need to software render OpenGL in Windows and have already found about Mesa3D
I am developing an iOS game that will need to render 500-800 particles at
I'm trying to write a C++ windows service that can render to a texture.

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.