Advertisement

Normal Mapping Code

Started by June 20, 2004 02:00 PM
43 comments, last by cippyboy 20 years, 5 months ago
@cippyboy: Basically the texture unit is the unit that blends texture with other colors (typically colors resulting from lighting), and the texture object is the image itself with few parameters (like how it should be filtered).
Each texture unit uses a texture object, and each texture object can be bound to one or more texture units at the same time.
All glTexEnv and glTexGen calls work on the current texture unit. The current texture unit is changed using glActiveTexture.
All glTexImage and glTexParameter calls work on the current texture object. The current texture object is changed using glBindTexture.

So, what I mean is that you have to setup texture filter control at the texture unit lvel, that is once you called the correct glActiveTexture. And you have to setup hardware mipmapping at the texture object level, that is once you called glBindTexture with the correct object.

@DarkWIng: yes it's in the core since 1.1, just like vertex arrays, polygon offset and few other things. Most people don't know it has ever been an extension since it's natural to use them (glad OpenGL1.1 was shipped with Windows, they could have shipped OpenGL1.0! imagine the hassle...)
[vincoof] Thanks a lot (I don`t know why but everytime I post in here, I have to double post because there`s an error when I send the post, but anywaym let`s get back)

I think we`re getting off-topic but... since we`re still here, do you know a good link where I could find the meaning of all extensions and sample code(I mean what if you know what it means if you can`t use it right, right ?) :)

Relative Games - My apps

Advertisement
Quote:
do you know a good link where I could find the meaning of all extensions and sample code


You can get specifications of all extensions at OpenGL Extension Registry, but it takes a while to get used to reading that :). Some of the spec files include short examples of use, but most(old ones) don't. You should look at nVidia and ATi's developer pages for demos with source that use specific extensions.
You should never let your fears become the boundaries of your dreams.
You certainly mean nVidia and ATi developer pages, isn't it ? ;)

And if you're new to extensions, you should start with this page.

And if you're still having trouble with extensions (even after some google help) feel free to post a new topic around here :)
Well... I just thought there`s some secret pot of wonders somewhere around here, I alreayd know the NVidia(well... I got a GeForce) demo "palace" but sometimes I hate the stuff with the documentation with no source... anyways I`ll drop it all here and start something else If I got a problem... now I`m working at a totaly different part of my engine and I only posted just to get some extra information if there was nay, thanks a bunch anyways ;)

Relative Games - My apps

This topic is closed to new replies.

Advertisement