Results 1 to 5 of 5

Thread: Creating Dynamic Textures

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2011
    Posts
    17

    Creating Dynamic Textures

    Hi,

    I want to create a texture at run time, such that the RGBA values of pixels of my texture depends on the surface normals of a triangular mesh.

    I already have a triangular mesh, and its moving like a sine wave. I want to texture it based on its orientation in space.

    I have been through some tutorials but my prob;em is that, I am unable to decide and dont have much understanding about what texture parameters should I pass to make this texture. (in function glTexParameterX() and TexEnvX ())

    Can you please direct me to related tutorial to give some sudo code to start with.

  2. #2
    Senior Member Regular Contributor
    Join Date
    Oct 2010
    Location
    France
    Posts
    458

    Re: Creating Dynamic Textures

    GL_CLAMP, GL_CLAMP_TO_EDGE should be good. Also GL_NEAREST for minification and magnification (no mipmap values for the latest).

  3. #3
    Junior Member Newbie
    Join Date
    Mar 2011
    Posts
    17

    Re: Creating Dynamic Textures

    What should be the parameter in
    {code:
    glTexEnv(GL_TEXTURE_ENV,GL_TEXTURE_ENV_MODE, parameter)
    }

  4. #4
    Newbie Frequent Contributor
    Join Date
    Mar 2016
    Posts
    896

    Re: Creating Dynamic Textures

    GL_MODULATE or GL_REPLACE probably, depending on whether you want lighting to have an effect on the textured surface - this is not different for a generated texture than for one loaded from an image file though.

    pixels of my texture depends on the surface normals of a triangular mesh
    why not use vertex colors for this (it sounds as if you are updating the vertex positions/normals every frame, you might as well update vertex colors while you are at it)? If you happen to use shaders you don't even need those, but you can compute the color from the normal direction on the fly.

  5. #5
    Junior Member Newbie
    Join Date
    Mar 2011
    Posts
    17

    Re: Creating Dynamic Textures


    Hi,

    Yes, I am updating the vertex positions every frame, and yes I want lighting to have effect on textured surface, but I am not updating the vertex colors(might be this is right thing to do but I don't know other way around) because I have textured the mesh with an image of water surface and now I want to blend reflections when the wave moves.

    So , I want create new texture of wave movement updated at each frame and blend it with the first texture.

    Also, how do I get new boxes for Quote: and code: while writing a post,I looked for the tool but couldn't find around.

Similar Threads

  1. Creating dynamic heightmaps
    By Andrew Davey in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-12-2004, 01:59 PM
  2. Creating dynamic geometry in real time
    By thomas giusepe in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 12-20-2001, 12:40 AM
  3. Creating dynamic arrays ??
    By Bruno in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 02-13-2001, 04:03 AM
  4. Using Dynamic textures...
    By thados in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 09-10-2000, 09:22 PM
  5. dynamic textures
    By jc in forum OpenGL: Advanced Coding
    Replies: 10
    Last Post: 08-11-2000, 07:37 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
  •  
Proudly hosted by Digital Ocean