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 8507153
In Process

The Archive Base Latest Questions

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

I have just started learning OpenGL ES 2.0, during the process I met some

  • 0

I have just started learning OpenGL ES 2.0, during the process I met some terms that do not make sense to me even if there are definitions. Like this one: Interpolation

From the book OpenGL ES 2.0 Programming Guide, I see this definition for interpolation:

The mechanism used to generate a varying value for each fragment from the varying values assigned to each vertex of the primitive is called interpolation.

Though I understand what Linear Interpolation is from this answer, the definition above does not make sense to me.

Would you put it another way and make an example to elaborate on what interpolation is?

  • 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-11T02:47:19+00:00Added an answer on June 11, 2026 at 2:47 am

    As for a general definition “in other words” you could find a few on web.. As for example I could try to explain this to you:

    You use interpolation when you have a limited amount of data trying to represent unlimited amount of data, for instance, you have 2 points representing a line:

    For interpolation you always need a hint of representation, in line case you need 2 points (and the hint is “it’s a line”), lets say they are vectors A and B. Now the solution is T(s) = A + s*(B-A) for any real number ‘s’ to get endless line in both directions. To get a line between A and B you need to define ‘s’ on the interval [0, 1] so that T(0)=A while T(1)=B and this is linear interpolation.

    For a bit more complex interpolations you can look into openGL a bit:

    Note that the algorithms used in GL and your GPU are much more complex and optimized then what I am about to write here but generally have the same result.

    In case of shapes you usually use triangles defined with 3 vectors (vertex) and say that it is a triangle (you say ‘triangles’ in your draw method). After applying some matrices to those vectors you will get their 2d projection on the draw buffer (can happen in vertex shader). Now you need to fill all those points in the buffer with some color, texture or color interpolations. First of all, all those drawn points (their position on the buffer actually) are a result of a linear interpolating mechanism (you have no control of it in GL). Second as to what color will be filled is usually again the linear interpolation:

    Try drawing a triangle with vertices of different color by setting a color pointer. You will get a nice smooth color specter on the whole surface that is a result of a linear interpolation of colors depending on interpolation of positions (you get the position interpolation result in fragment shader for each pixel that needs to be drawn). You could manually achieve this color interpolation result like this:

    input:

    Vector a, b, c; //original triangle positions
    Vector interpolationABC; //current fragment interpolation between a, b and c
    Color colorA, colorB, colorC; //colors for vectors a, b and c
    

    output (color of this fragment):

    Color output = (
    (a - interpolationABC).length() * colorA + 
    (b - interpolationABC).length() * colorB + 
    (c - interpolationABC).length() * colorC ) 
    / (
    (a - interpolationABC).length() + 
    (b - interpolationABC).length() + 
    (c - interpolationABC).length() );
    

    This mechanism again represents a linear interpolation (a very slow one actually, but it should do the trick and is very readable)

    As for an example of non linear interpolation you will need a bit of imagination: Lets say we are drawing a sphere. For purpose of keeping it simple let’s say it’s center is in (0,0,0) and its radius is 1. The sphere is created with N triangles and if N is not large enough (most cases) because of performance issue it is a bit “edgy” and we would like to smooth it out a bit. So we have to turn on some lights (it’s just a circle with no lights anyway) and figure out how to set normals. On one hand you can compute a normal for surface defined by 3 points and each triangle will have a unique normal but will produce “a disco ball” effect, on the other hand you know that a normal of any point ‘P’ of sphere is normalized(P-center) or in this case the point itself. So each vertex normal is the vertex’s position itself (so now each triangle has 3 different normals) and each fragment’s normal is an interpolation of those normals:

    If you use the same interpolation mechanism as for colors you will see that the length of normals is not “constant”, resulting in flaw, forcing you to use a different mechanism (non linear). In this specific case you could simply normalize those linear fragment results and get the result you need, but also in this specific case you could just compute the normal from fragment position (you can do that for any shape that is mathematically presentable). But know in practice you will get a strange shape that has smooth parts and edges and might have normals of different size to represent some awesome effect and that is why there are great mechanisms for interpolating different parameters on shapes.

    Again, interpolation mechanism is a mechanism that can produce unlimited number of results by knowing only a limited number of data (one of those mechanisms is called “linear interpolation”). Or in other words as you posted for a bit more specific example:

    The mechanism used to generate a varying value for each fragment from
    the varying values assigned to each vertex of the primitive is called
    interpolation.

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

Sidebar

Related Questions

I have just started learning OpenGL and I am attempting to make a game
I just started using/learning Python and have some questions. I have a text file
I have just started learning XNA. This is my first program that I am
I have just started learning Erlang and am trying out some Project Euler problems
I have just started learning python/matplotlib/basemap and could really use some help. How do
I have just started learning C# and would have one question that I cannot
I have just started learning OpenGL using the tutorials on Nehe, and so far
I have just started learning python version 3 and trying to create a file
I have just started learning Rails, is it required for me to learn CoffeeScript
I have just started learning Jquery and am new to writing javascript (I am

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.