Results 1 to 9 of 9

Thread: Multitexture with more than 2 textures.

  1. #1
    Senior Member Regular Contributor
    Join Date
    Oct 2002
    Posts
    164

    Multitexture with more than 2 textures.

    Hello.

    I have a working programe that puts two textures on a cube.
    Now I wanted to add a third texture and run into some problems.
    Mainly what happens is that the third texture totaly substitutes the second one.
    Although I only have the 'third' texture on one face of the cube it appears everywhere instead of the second one.

    I cannot see any obvious reason for that.
    Is the approach to more than 2 textures different to only 2 textures?

    Thanks for any help!
    I may not be good looking but I sure am dumb.

  2. #2
    Senior Member Regular Contributor
    Join Date
    Apr 2001
    Location
    Fort Collins, Colorado
    Posts
    446

    Re: Multitexture with more than 2 textures.

    Are you using multitexture, or multiple drawing passes? Radeons have 3 texture units so you can do 3 textures in one pass, Radeon8500 has 6, Geforce2 has 2 texture units, and I think Geforce3 and 4 has 4 units, but I'm not positive on that. If your card only supports 2 texture units, you'll have to do a second rendering pass to get the third texture to show up, and use the correct mode (GL_MODULATE?).

    Also, if you only want the 3rd texture to show up on one face of the cube, disable texturing after drawing the first face and it won't be drawn on the subsequent faces.

    Hope that helps.

  3. #3
    Senior Member Regular Contributor
    Join Date
    Oct 2002
    Posts
    164

    Re: Multitexture with more than 2 textures.

    Yes it indeed helps.
    At some point it came to me that my GeForce 2 can only draw 2 textures in one pass, and you confirmed that.
    Is it hard to design a second rendering pass?
    If you could point me to some tutorial that would be kind of you.
    Thanks for the help!
    I may not be good looking but I sure am dumb.

  4. #4
    Senior Member Regular Contributor
    Join Date
    Apr 2001
    Location
    Fort Collins, Colorado
    Posts
    446

    Re: Multitexture with more than 2 textures.

    Cool, glad that helped you out.

    As far as multipass rendering, you basically just draw your object again, with the blending mode set to your desired effect. I think a good explanation of the differences is here: http://www.delphi3d.net/articles/vie...ghtmapping.htm

    A cool project to see/learn the difference in multitexturing and multipass rendering would be to do a simple lightmapping technique of a quad, and toggle between multitexturing and 2 passes to get the same effect. There's a good multitexturing tutorial you could base this on at: http://www.gametutorials.com

    For more info I'd suggest a google search on "opengl multipass rendering" or something like that, should help you get the general idea.

    Good luck, and let us know how it turns out.

  5. #5
    Senior Member Regular Contributor
    Join Date
    Oct 2002
    Posts
    164

    Re: Multitexture with more than 2 textures.

    Thanks for the links!
    I have no time to check them out in detail right now. (my multitexturing code is based on a www.gametutorials.com tutorial, do we mean the same?)
    I got a question though. You said that I basically just draw my object again, does that mean that I realy draw it again, with all the geometry and so on?

    Thanks again for the links, I'll check them out later.
    I may not be good looking but I sure am dumb.

  6. #6
    Senior Member Regular Contributor
    Join Date
    Apr 2001
    Location
    Fort Collins, Colorado
    Posts
    446

    Re: Multitexture with more than 2 textures.

    Yes, I believe we are talking about the same tutorial at http://www.gametutorials.com That was a very helpful tutorial to me when I was first learning about multitexturing, since it is a very simple example that made the concepts easy to grasp.

    So my suggestion was to turn that tutorial into a program that would allow you to draw the lightmapped quad 2 ways, via multitexture (as it exists now), and then with the press of a button it would change to a multipass algorithm instead.

    Basically, you would draw the quad with the base texture. Then, set your blending mode to get the desired effect, bind the lightmap texture, and then draw the same quad again. This should have the same effect as drawing the quad once with multitexturing, but will show you how the multipass rendering works.

    Hope that makes sense.

  7. #7
    Senior Member Regular Contributor
    Join Date
    Oct 2002
    Posts
    164

    Re: Multitexture with more than 2 textures.

    Umm yeah, of course it makes sense.
    I have no idea though how to achieve multipass rendering in OpenGL. I cannot imagine how those two cubes will fit together. hmmmm...
    I may not be good looking but I sure am dumb.

  8. #8
    Senior Member Regular Contributor
    Join Date
    Apr 2001
    Location
    Fort Collins, Colorado
    Posts
    446

    Re: Multitexture with more than 2 textures.

    Perhaps this article can explain it better than I am able:
    http://excamera.com/articles/1/

  9. #9
    Senior Member Regular Contributor
    Join Date
    Oct 2002
    Posts
    164

    Re: Multitexture with more than 2 textures.

    Ha, you are a genious!
    Now I got 4 different textures on one cube
    (running on a GeForce2), so the main goal is achieved. I am still having minor 'problems'
    to control how the textures are blended together between the two passes, but I guess I will find some satisfying solutions for that.
    I have definitely 4 textures on that cube, though, and thats nice.

    Thanks alot for the help!
    I may not be good looking but I sure am dumb.

Similar Threads

  1. multitexture
    By davidib in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 02-11-2005, 01:46 PM
  2. MultiTexture and VBO
    By azcoder in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 06-15-2004, 07:10 PM
  3. Multitexture without textures
    By hh10k in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 02-24-2004, 07:46 AM
  4. MultiTexture
    By tiammazzo in forum OpenGL: General
    Replies: 1
    Last Post: 06-03-2002, 04:36 PM
  5. Multitexture?
    By haigu in forum OpenGL: Advanced Coding
    Replies: 8
    Last Post: 09-16-2000, 11:46 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