i have always wondered this... does anyone know if there would be any way to... emulate? is that the right word? anyway if so, is there anyway to emulate bump mapping for sprites on mmf2, or i guess any other click team product. i've got no idea whats out there. well i do, but i'm not sure how to use them... all. GAH i'm tired... yeah so BUMP MAPPING. any way? i would love to know if anyone has any ideas. i don't need explination, but i'd still like to have a look into it.
I can't recall anyone ever doing it in MMF. You'd have to create an extra channel to store the height/depth of each pixel in the sprite, and it's really not the easiest thing to do in MMF, especially if you want to apply the effect to many objects at the same time, etc. I'm thinking arrays, but that'd cause problems when working with multiple objects.
Another way would be to use alterable strings or values or something. Either way, it's gonna require some leet skillz to pull off, so meh. I'm waiting for someone to come in and prove me wrong though, because I know next to nothing about these things anyway.
You'd need another channel and a light source. I don't think I've seen 2D bumpmapping been done before, I thought it was limited to a 3D light source on a texture.
i know its not mmf, lol thats for sure. but it proves it can be one. i'm wondering if you can somehow analyze the brightness of colours through some extension... and then add even more brightness accordingly. but i can't imagine how. i would've thought it would be done through arrays... but lol yeah O_o?
Originally Posted by Toe_Fungus i know 2d bumpmapping can be done. i've seen it in an incredible game called hammerfall, you can find it clearly shown here. http://www.fun-motion.com/physics-games/hammerfall/
Oh yeah, I've seen that game. I really can't tell if it's bump mapping/dynamic lighting in the works there though.
Originally Posted by Toe_Fungus i'm wondering if you can somehow analyze the brightness of colours through some extension... and then add even more brightness accordingly. but i can't imagine how. i would've thought it would be done through arrays... but lol yeah O_o?
It's got nothing to do with analyzing the brightness of the sprite. You set up a second image of the sprite, where the color of each pixel tells the renderer how much that pixel "stands out", so that it can generate shading/lighting accordingly. That's how it works.
... At the moment images in MMF are done in 3 or 4 channels (RGB + Alpha) to have bump mapping you need another channel for the "height" of that pixel. That's how the mapping works out how the light would play over the surface. To do it manually would be a pretty extreme challenge, calculating it is one thing but actually lightening and darkening single pixels at runtime is something I don't have a clue on (well not a way that is practical).
I could probably do it for ONE object at runtime and it's not worth the effort to be honest, we'd need an easy way. (I don't know if a pixel shader could handle this in any way... With HWA coming and all)
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
24th January, 2008 at 18:10:30 -
This was made in MMF 1.5
I don't know if it will be useful to you, I'm not sure if it works properly in MMF2 because of the updated extensions, but you can still look at the code:
hmm... this is quite a puzzle. there is no way of somehow replicating the brightness or contrast etc into a value which in practise becomes depth? *ponders* what about... hmm... no *contemplates* ... ... ... perhaps its just a lost cause. how was it done on that hammerfall game!!! gah, damn their malevolence.
It's most likely just done the same way it would be in 3D but they've just restricted the game to use two axis rather than 3. You could try to get a height value by averaging values etc... I'm not sure it would be correct per say. It's more rendering it that is the hard part.
Ok, I have an idea about this, I'm not shore if it would work but I'll put it out there anyway.
You could try using a sprite as a semi-transparent overlay. For every animation, possibly including alternat directions, you would have a corresponding animation in the overlay sprite. You would use the directions in the overlay sprite to change the directions of the shadows on the main sprite. This way you can have the overlay sprite always looking toward the closest light sorce and as long as you've dune the pre-rendering right you should be able to fake the effect.
In order to make the directions for the shadows. First I'd make a black and white bumpmap for my charecter. I'd go into Photoshop and use the render lighting effects. I'd position the light in the 32 directions that MMF suports, I think you can save custome presets and I would definatly use a macro to help with all the frames. This should give you the shadows.
Though it would be considerably less work for something like a car as oposed to a human. This would still be pritty tedious and time consuming way to do it. Also you won't be able to get it looking perfict. However if you were to slug through it you could probably acheve a cool effect that I don't think would caus much slowdown at run time. You wouldn't even need to use any extensions, just give it a tint value.
"Oh, my god! A lightning monster just ripped out this poor woman's eyes, and your mocking her shrubbery!" - The Spoony One
Yeah, but as you said, that's a lot of work, and it's still not the real thing. And it wouldn't allow for multiple light sources and stuff like that. But if you're prepared to go such lengths just for a half-arsed version of the effect, then sure =P
The reason why they can do stuff like this in other languages is that they have much more control over their bitmaps and blitting/drawing operations than we have in MMF. Languages like C++ are harder to learn, and more abstract, but so much faster and more flexible than MMF when it comes to things like this.