Render passes
After coming back to my old code, arrange hundred versions of the same files, and being able to compile some of my past project I could finally started again coding some modifications to my old 64kb Introsystem.
One of the things that gaves me many headaches was the material manager. And of course it couldn't resist to come back to me :D.
During all this time a lot of things have changed related to the treatment of the materials, shaders, render passes and so on. So I decided to spend few days asking my dear friends and making draft on papers about how to manage that problem.
Having in mind that it will be used in 64kb intro I needed to have the feet on the ground and try to keep it simple
So here is it my first draft.

The main class is Scene were you store all the nodes. After loading the objects you just add the passes you need for each material on each group of objects using addPass
During rendering, you should call on each frame update to compute the transformation matrix for each node.
Right after compute the matrices you could call render function that will iterate throw all the passes for the scene:
void Scene::render() { setGlobalState(); setWorldTransformation(); for (iPass=0;iPass<passesList.Count;iPass++) passesList[iPass].render(); restoreWorldTransformation(); restoreGlobalState(); }
In the Pass::Render() function we should just activate the current render context (Usually just a camera, or a render to texture object), following by the call to apply the selected material:
void Pass::render() { renderContext->activate(); material->applyMaterial(objectList,sceneID); }
Finally the ApplyMaterial function do all the passes for each state and shader program to the selected objects passed by parameter (We're assuming a scene manager singleton):
void Material::applyMaterial(objectList[] objList, int sceneID) { for (int iPass=0;iPass<numPasses;iPass++) { loadPrograms(iPass); setStates(iPass); vprogram=getVProgram(iPass); pprogram=getPProgram(iPass); for (int iText=0;iText<numTextures;iText++) loadTextures(iPass,iText); vprogram->activate(); pprogram->activate(); // Get the scene from singleton and // render the selected objects SCENE_MANAGER.Get(sceneID)->renderSelected(objList); // Disable everything vprogram->deactivate(); pprogram->deactivate(); unloadTextures(); restoreStates(iPass); } }
Note also that in the last code you could use something like setCurrentPass(iPass) on each iteration instead of call all the methods with this parameter. I just left it like that to make it clear that those functions are dependents on the pass
That's all for today. I'll try to implement it during next days. I'll let you know how is going :) (Give me luck)
Hello world, once again :)
Well I just opened a Visual Studio project and start to drop few lines...
Maybe It's just that I've felt bad all this time because I started so many projects, so many tools, and they just got stuck somewhere.
But right now I just got a little power and I'll try to get something back from all of them.
I hope it will push back someone else once again at least for one more time, since we had many things to say that remain unsaid :P.
Yes... I know it's not very good time for scene, and we're getting older, but it still could be funny :)
PS: Anyway... you know... it will go slow :P
Give me your IP
When you need to give support to a computer user the best way is to create a remote connection to his computer.
I usually use vnc, but even having it installed on the final user, it could be so hard to explain how to find out the IP to create the connection.
...Close to the clock in the bottom right it should be an VNC icon, please put the mouse over for a while and they'll appear some numbers...
...Ok go to the Start menu, click "Run" and after write "cmd" in the textbox. It will appear a black screen, type "ipconfig" and click enter, now copy the numbers...
It's easy to imagine how people with low level in computers could be lost when you ask them to do those tasks.
So I just wanted to create a page where you could simply watch your IP without advertisement or funny stuff that could disturb the user. It's just a simple $_SERVER['REMOTE_ADDR'].
But many times I need to help my parents throw messenger and I just wanted to make it even easier for them so I just created a simple page where you can just copy a generated URL and paste to them.
They'll click and it will appear on their screen just the text "OK!", after that you could click on "Get the IP!" button (AJAX Coming soon :)) and you'll get their IP address.
Simple but quite effective and effortless :)
You can see and use it here