Results 1 to 4 of 4

Thread: How to load multiple Texture

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2003
    Posts
    27

    How to load multiple Texture

    How to load Multiple Textures?
    Some of them are just lookup table I will use int teh fragment program.

  2. #2
    Super Moderator OpenGL Guru imported_dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    3,966

    Re: How to load multiple Texture

    Just use glTexImage2D with the current multitexture target set using the glActiveTexture call. Binding subsequent to your load should also work on the active texture.

  3. #3
    Junior Member Newbie
    Join Date
    Jul 2003
    Posts
    27

    Re: How to load multiple Texture

    in fact
    what I am trying to do is use one texture as an lookup table.

    so 1st.
    color1 = Texture(r,s, t)
    then I use the alpha value of color1 as the index of to find color on 2nd one dimension textures.

    I use cg..
    can I direct use color as the index to lookup at the another map?

  4. #4
    Junior Member Newbie
    Join Date
    Apr 2003
    Posts
    26

    Re: How to load multiple Texture

    Yes, you can. I have no idea how to do this in Cg, but I use nvparse for texture shaders. But since cg is only a layer on top of OpenGL, there is also a way to do this in Cg. I use the "dependent_ar" texture shader to use the alpha value of a texture unit to look up a value from another texture. I configured texture units as follow:

    tex0: a decal texture (texture_2d(); )
    tex1: lookup texture (dependent_ar(tex0); )

    Texture unit 1 uses the alpha and red channel of texture unit 0 as (s,t)-coordinates to look up some value. There are more dependent texture shaders for 1D and 3D textures. Check out the NVidia OpenGL spec.

    [This message has been edited by mako (edited 07-27-2003).]

Similar Threads

  1. Replies: 9
    Last Post: 11-02-2018, 08:16 AM
  2. Trying to load multiple models in C for openGL
    By RET80 in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 12-03-2011, 08:10 PM
  3. load and display multiple 3d model
    By fitt0 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 09-29-2009, 08:43 PM
  4. Replies: 1
    Last Post: 11-30-2005, 03:12 AM
  5. Load multiple images on a single 3D Object question
    By waldoo in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 01-25-2002, 04:39 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