Results 1 to 2 of 2

Thread: Missing TexEnv* functions

  1. #1

    Missing TexEnv* functions

    I am looking at this tutorial http://www.clockworkcoders.com/oglsl/tutorial8.htm which has the following codes:
    Code :
    glActiveTextureARB(GL_TEXTURE0_ARB);
    glBindTexture(GL_TEXTURE_2D, texture1);
    glEnable(GL_TEXTURE_2D);
    glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
    glTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_REPLACE);
     
    glActiveTextureARB(GL_TEXTURE1_ARB);
    glBindTexture(GL_TEXTURE_2D, texture2); 
    glEnable(GL_TEXTURE_2D);
    glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
    glTexEnvf (GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_INCR);
    I could not find the equivalent of glTexEnvf() function on WebGL Specification https://cvs.khronos.org/svn/repos/re...ebGL-spec.html

    I assume that they are omitted from WebGL. Correct?
    If so, how do we do the equivalent features? Is it possible?

    Thanks in advance for your help.

  2. #2
    Senior Member
    Join Date
    May 2010
    Posts
    207

    Re: Missing TexEnv* functions

    WebGL is based on OpenGL ES - not on OpenGL. OpenGL ES strips OpenGL to the barest minimum - and in OpenGL ES 2.0, we have shaders - and shaders can implement everything that glTexEnv does.

    glTexEnv is all about how textures are applied to the base color of the polygon - and how textures are combined - but when you have fragment shaders, you get the raw texture values from 'texture2D' and you can decide whether the resulting color modifies the base polygon color - and how multiple textures are combined - using simple math operations.

    So - you're right - glTexEnv isn't in WebGL or OpenGLES2 - and it's not needed.

    Simpler is better - and shaders are cool!

    -- Steve

Similar Threads

  1. Built-in Functions: Work-Item Functions
    By sean.settle in forum Suggestions for next release
    Replies: 7
    Last Post: 11-17-2011, 07:39 AM
  2. glOrtho is missing?
    By Esaras in forum OpenGL ES 2X - for programmable 3D graphics pipelines
    Replies: 5
    Last Post: 10-27-2011, 05:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •