Just playing around a little with Devkitpro and libogc. I took gx lesson7 as a base and added normal mapping to that.
To run it, get bannerbomb, unzip it to a sdcard, download this, rename it to boot.dol and put it in the root of your sdcard. Then follow the instructions on bannerbomb to actually run it.
Dolphin runs it too, though, the colours seem to be more bright. Besides that it is about 5-6 times slower (I mistakenly wrote 15 last time) and the mote emulation doesnt work on my laptop.
What you'll see is 3 cubes, lit by a lightsource on the right. The ambient lighting is done by using the normal map with a lightsource at the cam's position (which is also used for reflection). In this form, it simply adds reflection and diffuse calculations. It takes a stage to determine if the light is on the front of the surface (that's when you'll see the effect fade out) and two indirect stages to add diffuse and reflection light colour. I haven't implemented distance attenuation yet.
The last stage, also indirect, adds the ambient map. Just using a static material texture for that would be faster I guess but for now I haven't. Picked the normal map somewhere from the internet... Lost the url but that guy demo'd how to make normal maps in some 3d tool anyway.
The fastest setup would be just diffuse and abandon the fade out (which you could get away with in certain circumstances anyway).
Still have to sort some suff out, I get a wrong texture format in the indirect unit so I had to convert R and G channels to B and G. Furthermore, I have to sort out/experiment a little with changing the lightmaps scale and bias. Currently I use separate maps for diffuse and specular but it isn't ideal.
I changed the button functions a little: A button toggles reflection/specular, minus toggles vsync (hold it a bit longer) and the direction pad allows to rotate the light around the cam (hold it as classic controller). Don't mind B and plus buttons.
Have fun!
To run it, get bannerbomb, unzip it to a sdcard, download this, rename it to boot.dol and put it in the root of your sdcard. Then follow the instructions on bannerbomb to actually run it.
Dolphin runs it too, though, the colours seem to be more bright. Besides that it is about 5-6 times slower (I mistakenly wrote 15 last time) and the mote emulation doesnt work on my laptop.
What you'll see is 3 cubes, lit by a lightsource on the right. The ambient lighting is done by using the normal map with a lightsource at the cam's position (which is also used for reflection). In this form, it simply adds reflection and diffuse calculations. It takes a stage to determine if the light is on the front of the surface (that's when you'll see the effect fade out) and two indirect stages to add diffuse and reflection light colour. I haven't implemented distance attenuation yet.
The last stage, also indirect, adds the ambient map. Just using a static material texture for that would be faster I guess but for now I haven't. Picked the normal map somewhere from the internet... Lost the url but that guy demo'd how to make normal maps in some 3d tool anyway.
The fastest setup would be just diffuse and abandon the fade out (which you could get away with in certain circumstances anyway).
Still have to sort some suff out, I get a wrong texture format in the indirect unit so I had to convert R and G channels to B and G. Furthermore, I have to sort out/experiment a little with changing the lightmaps scale and bias. Currently I use separate maps for diffuse and specular but it isn't ideal.
I changed the button functions a little: A button toggles reflection/specular, minus toggles vsync (hold it a bit longer) and the direction pad allows to rotate the light around the cam (hold it as classic controller). Don't mind B and plus buttons.
Have fun!