[Open GL] Multitexture blending

Discussion about everything. New games, 3d math, development tips...
ent1ty
Competition winner
Posts: 1106
Joined: Sun Nov 08, 2009 11:09 am

Re: Incorrect opengl lighting :?

Post by ent1ty »

Congrats :)
irrRenderer 1.0
Height2Normal v. 2.1 - convert height maps to normal maps

Step back! I have a void pointer, and I'm not afraid to use it!
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Incorrect opengl lighting :?

Post by serengeor »

ent1ty wrote:Congrats :)
Thanks :wink:

And as I have suspected:
serengeor wrote:Here's a screenie of working (probably correctly :D) ligth:
I had depth test flag disabled (or should I say not enabled, cause default is disabled) in my material so the last screenshot still looks a bit weird if you'll give it a closer look. Enabled it and now it works like a charm :)

This is probably fixed, but I may return to this thread with other questions (so I wouldn't need to spam threads).
Working on game: Marrbles (Currently stopped).
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Incorrect opengl lighting :?

Post by serengeor »

Finally got texture to show up :o
Image
I currently only have TGA loader. (Had to make bunch of stuff just to get into doing the loader).
He looks kind of blue'ish, but I think I just made some wrong settings somewhere.

Oh and excuse dwarf for missing his axe, he said he isn't going to war soon.

BTW. Where is the thumbnail link gone in ImageShack?
Working on game: Marrbles (Currently stopped).
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: [Open GL] Multitexture blending

Post by serengeor »

It's me again with another problem. I've been trying to add multitexture blending support to my renderer for a few days, though with no success so far.
The code I've tried to use with my renderer was from samples around the net and also generated by this app: http://developer.amd.com/archive/legacy ... fault.aspx

Neither code has worked so far, the results were either black texture, first texture, or white texture. No gl error has happened with either of those situations.

What I'd like to as is what would be the steps to correctly use this technique?
Working on game: Marrbles (Currently stopped).
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: [Open GL] Multitexture blending

Post by hendu »

serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: [Open GL] Multitexture blending

Post by serengeor »

hendu wrote:http://cgit.freedesktop.org/mesa/demos/ ... multitex.c

Perhaps some source will help ;)
I couldn't find a single call to glTexEnv. Looking at the path to the file, is this glsl multitexturing? I'm implementing this using fixed function pipeline.

Edit: Found some other articles that might help, had to think of a new phrase to find it. It might just solve the problem.

Edit2: I think I solved it, I can see the two textures now show up.
The problem was that I only activated and set glTexCoordPointer once.
Working on game: Marrbles (Currently stopped).
hendu
Posts: 2600
Joined: Sat Dec 18, 2010 12:53 pm

Re: [Open GL] Multitexture blending

Post by hendu »

Yeah, sorry, didn't catch that you were doing fixed.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: [Open GL] Multitexture blending

Post by serengeor »

hendu wrote:Yeah, sorry, didn't catch that you were doing fixed.
It might come in handy in future, now I'm only implementing the fixed function pipeline stuff. Thanks anyways :wink:
Working on game: Marrbles (Currently stopped).
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: [Open GL] Multitexture blending

Post by serengeor »

Ambit_Energy wrote:How I wish I can learn same as you do soon.

Just starting to crawl for studying on how to make all this.






:oops:
Learning opengl is not really hard, just sometimes it gets tricky with documentation.
Must read every line of it. Miss a few lines and it can become head pain trying to figure out what is wrong with your code.
Having a good book is also a very big plus. Also it might be good to study some other sources to see how things can be made.
Working on game: Marrbles (Currently stopped).
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: [Open GL] Multitexture blending

Post by REDDemon »

Have you tried to texture a simple quad to see if the problem is the TGA loader?
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: [Open GL] Multitexture blending

Post by serengeor »

REDDemon wrote:Have you tried to texture a simple quad to see if the problem is the TGA loader?
tga loader might be buggy for alpha textures, can't imagine why though as it is just additional alpha value at the end which is basically left untouched. Multitexture blending however works now, though I need to tweak it a bit.

Edit: The tga loader was indeed messed up a bit, I've fixed it and now it seams to load textures with alpha channel also ok. :)
Working on game: Marrbles (Currently stopped).
REDDemon
Developer
Posts: 1044
Joined: Tue Aug 31, 2010 8:06 pm
Location: Genova (Italy)

Re: [Open GL] Multitexture blending

Post by REDDemon »

very well :)
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Post Reply