Hello All...
I hope you have all had a browse through the September Newsletter by now. If you have, you will have noticed Lee's CubeMapping example/tutorial in there(using a shader by Green Gandalf).
The technique is very cool looking, and is very close to something that I needed to accomplish for some other project's.. with that in mind, I decided to see if the technique would port to GDK without too many problems.
My only concern was the fact that in Lee's article in the newletter, he mentions that these techniques for cube mapping are working in the U7.5 DBPro beta, due to a "Tweak" of some kind. He doesnt actually mention what the tweak is in relation to, but I suspect it was something to do with Shader Textures... as I can get the technique working, but I have to tell the shader to use it's own textures(even though it doesnt have any named ones inside it, it only works when it thinks it's using it's own textures-wheras in the DBPro code, its loaded NOT using its own textures, doing that in GDK results in a black untextured object lol)
Ok, I have ported the technique over to GDK and it works fine, both with and without the shader normal mapping... Yes, you can have just the dynamic cube map(which is what I am interested in actually) without the textures too in this demo - although doing it in a game would be more complex as you would need to manage the texture stages properly(it doesnt like anything in tex stage 0, I had to tell it to texture itself with a nonexistant image in stage 0 to get it to work - which still surprises me lol).
The DEMO that I have put together is based almost 1:1 from the DBPro source that you can get from September's Newsletter, with only a few minor changes for C++ made, and some small tweaks to GDK.
Press [SPACEBAR] to change the object and keep the Normal Mapping shader applied.
Press [RETURN] to change the object with only the Dynamic Cube Map applied.
Here are 2 screenies of the program running :
With Normal Mapping :
Without Normal Mapping, just cube map :
The Attachment contains the Source code file, the FX file and the media required, and also a compiled and working EXE to demonstrate. The EXE was compiled with GDK7.4 and March09 DXSDK.
My reason for posting this is that the technique is really cool, and something I believe people may have a use for.
I am continuing to experiment with this technique and simplifying it. If I end up with anything interesting Ill post bak to let everyone know, but I mainly wanted to get cube mapping down as its used in a number of shaders that I am playing with for both reflections and shadows, usually calling the DBpro Render Dynamic Cube Map command, which causes exceptions in GDK... hopefully this technique should be able to be slotted right in if I can get it to work properly.....(shouldnt be too hard to make it use a single camera and swap out render targets or something....)
Lastly, I would like to Thank both Lee and Green Gandalf, for putting their time into getting a cube mapping demo done for us.
The Shader file the Green Gandalf made hasnt been touched at all, and is exactly the same as the DBpro version. Lee's source has only been changed minimally.
If it ain't broke.... DONT FIX IT !!!