256x256pixel textures

Started by
48 comments, last by Harrism 18 years, 3 months ago
You've succeeded in sounding quite rude to several people who have genuinely given good advice you were unable to follow.

Quote:the question I had was one of the simpliest there is if you couldn't explain it to me then you should seriously doubt your own teaching and helping methods.


My exact example of how to get the texture to display on a quad works just fine when a texture is properly bound and initialized. I figured you already had the proper binding code if you got a 256x256 image loading. It's obvious you don't understand what you're doing. You can muddle through it with examples you copy/paste without understanding into a frankenstein codebase if you like. I doubt very much that you'll ever be able to explain why something works, or even to detect when it isn't working well. You'll certainly lack any deep understanding of "your" own code.

What you call "faffing about" I call "learning how to use your tools properly"

It's like if I handed you a set of power tools and instead of reading up on how to use them all together to build a desk you pick up the hacksaw and go to town on a block of wood. Nevermind the fact that there are levels, vices, and other things which would make development smoother and would ultimately bring you a (better) product.

Good luck anyway, I pray I never run across some of your code in a project I work on in the future.
_______________________"You're using a screwdriver to nail some glue to a ming vase. " -ToohrVyk
Advertisement
I'm sorry Mt, it wasn't you who made me snap it was bunny's reference to being spoonfed. I never asked, and when it comes to the copy and paste code you both referred to; what point is there trying to build a woodern desk blindfolded? You'll probably end up cutting off your own finger and making something which doesn't resemble a desk at all. If you cannot see a result for 100 lines of code you've just written it's pretty much the same thing. When it comes to learning the same thing applies, if you cannot see an output you cannot understand what your code actually does. It's like being a deaf composer, some can do it, but we cant all be Beethoven. If you can see the output to what you've just written you can start to modify, changing, twisting, learning, and seeing all the possibilities there are, if it doesn't work you know where your going wrong. Like a block of wood when you've seen an example of how to use a saw you can begin cutting a bit of wood yourself you don't need any instructions using a sander or coping saw, all you need is common sense an open mind and an example of it's use in play.

As to "my" code, it will be that, my code. I won't nor use anyone elses code in my programmes, I've been using this method of coding since I was 8, it's worked til now and still seems to be the best method for learning. Granted there are reasons I could still learn we could all learn which wood you shouldnt use, you could either listen to the teacher or try it out yourself and learn the names later. I'd prefer to try it out myself. I learn by example, that way I'm more likely to remember it.

It wasnt you mt, and Gold was wonderful with his help, theres ratings :-) but bunny just snapped me. I might ask for help in the future but will remember this thread if no-one wants to. (I can't use someone elses code else it's not my program, even 3 lines will be like a needle in my side.) - And you can only help me with examples I am always reluntant when people start telling me how to do something I might as well be giving them my code and telling them to write it, theres no achievement. If you suggest something and say why that's a different cattle of fish. Well you could do this or this I'll listen. There's too many arrogent people online and not enough reasonable people I find. Anyway that's a different story. Your help was still great :-) I was referring to bunny's there, in my previous hence the quote.
Actually, my code doesn't need to be play tested since I already know it will work. That's the one downside with prgrammers today, most of it contains so many bugs patches are needed days and even weeks after, that's the advantage to my method. It has to be said. That's how well I know my own code.
<quote> I'd prefer to try it out myself. I learn by example, that way I'm more likely to remember it.</quote>

This is called 'reinventing the wheel'. Learning by example is nice, but what about existing libraries which do exactly that? It's good to know how these work, however implementing it yourself is 'non-standard'. Code reuse is important these days.

Crafter 2D: the open source 2D game framework

?Github: https://github.com/crafter2d/crafter2d
Twitter: [twitter]crafter_2d[/twitter]

This is true, this is why I didnt touch opengl for a long time, I felt the control was being taken away and somebody else was doing all the coding for you. Besides I'm here now because my code wasnt fast enough to do what I wanted. I prefer the low end to the high end.
Quote:Original post by Harrism
Intel 82830M (Dated: 2002)


Intel never liked the texture_rectangle extension so I'm not surprised they don't support it. The most efficient solution for you is going to be splitting the image into power-of-two tiles. Or get a new card.
guys, he doesn't need to know about extensions for this.

Just use mipmaps. It's pretty much the same as putting your 640x480 texture inside a 1024x1024 one and altering the texcoords, but it's done for you by glu.

there's a tutorial involving mipmaps here

This is not the perfect solution, but it saves you getting frustrated when all you are trying to do is draw a textured quad. In the long term you are better off with one of the other solutions. I just thought you might like to know the simple answer.
[size="1"]
Harrism,

On the first page of this thread, Benjamin Bunny posted links to the OpenGL specification for the two extensions that might be relevant to want you want. These documents explain in (often painful) detail the exact operation of the extension in the smallest detail. Or if not, they explain what details are intentionally left to be implentation-dependent and why. If you want to learn how to use these, then please skim through the summary sections of these files. If you read further, you'll learn a lot more though.

It seems like you might not be very familiar with OpenGl extensions. That's OK, most extensions are't useful for basic stuff anyway. You might want to find some good tutorials on what extensions are and how to use them. And you might want to take a look at GLEW. Its very easy to use.

Quote:
Actually, my code doesn't need to be play tested since I already know it will work. That's the one downside with prgrammers today, most of it contains so many bugs patches are needed days and even weeks after, that's the advantage to my method. It has to be said. That's how well I know my own code.

I will agree that some people, including me, learn best by doing. It is always useful to know exactly how something will work on the inside. However, and I don't want to sound mean or than I'm trying to discourage you, but saying things like this just makes it sound like you really don't have much experience with coding projects of any appreciable size. Not that I know anything about what the situation really is, but that's how it sounds.

Quote:
Besides I'm here now because my code wasnt fast enough to do what I wanted.

Optimization should never be undertaken until the code at least works. Working, but slow is alright: You can always improve your algorithms. For very small games, even GDI will do, really.
Quote:Original post by mrbastard
...
Just use mipmaps. It's pretty much the same as putting your 640x480 texture inside a 1024x1024 one and altering the texcoords, but it's done for you by glu.

there's a tutorial involving mipmaps here
...
That isn't just using mipmaps. It's also not packing the image into a larger texture and adjusting texture coordinates. gluBuild2DMipmaps internally scales (using gluScaleImage) a copy of the image data you pass it to the nearest power of two (nearest, not necessarily the next so it may downscale it) and uses that as the base texture level, then downscales it for each level to complete the mipmap chain. I just wanted to clarify because people often don't understand what exactly gluBuild2DMipmaps is doing.

If this is just for a background image the memory for the unused mipmap levels is a waste so if you wanted to go that route it would be better to just use gluScaleImage yourself. You can even make sure you always scale up so you don't lose the information you would if scaling down with gluBuild2DMipmaps.
Quote:Original post by Kalidor
nearest power of two (nearest, not necessarily the next so it may downscale it)

I didn't know that, but looking back on my experiences comparing mipmapped np2 textures and the original files, it makes perfect sense.

Quote:Original post by Kalidor
If this is just for a background image the memory for the unused mipmap levels is a waste so if you wanted to go that route it would be better to just use gluScaleImage yourself. You can even make sure you always scale up so you don't lose the information you would if scaling down with gluBuild2DMipmaps.

Good advice. I just wanted to show the OP the simple way most people use when they are learning. It's far from perfect, but is more at his level of understanding I think.

[size="1"]

This topic is closed to new replies.

Advertisement