Hey. So recently, I got into the Blender source, and I was looking around for something to try out. I found that there were three different kinds of OpenGL mist, and Blender already used the best one. So, just to see what it was like, I tried to implement the other two kinds of mist, and I’m surprised to be able to say that I succeeded! Huge thanks to Moguri for his help - I know that I’ll be looking to him on Freenode / #bgecoders a lot more.
The new mist types, EXP and EXP2 are worse, but they might be faster. In addition, you can only use the new Density slider with them - it won’t work for the normal, best, Linear-type of mist. In addition, the two new mist types only work in Multitexture mode (and Texture Face mode, as well).
This is really more of a test or proof-of-concept than anything, since it’s not an improvement. Still, it’s something to mess around with.
You can check it out and download the build for Windows 32-bit here.
Havent downloaded ur build so far but gr8! Hey if u plan to try something else now can you try to bring shadows which works without glsl to bge? Some games like project igi 2 had shadows that worked on my computer, even though it has only some intel graphics which dont support glsl.
Shadows are pretty complex - I might try to modify the already existing shading system, but I don’t think I’m ready to tackle a whole new kind of shadows. GLSL-less shading might be possible via particle filter shadows, in which pixels (planes) are placed over the camera and faded in or out depending on raycasts from the plane out to the scene. It can be implemented into Blender via Python, but it would most likely be too slow to use. You can also go with baking lightmaps, and using my lightmap example to read the ground’s shading.
I have a few ideas related to mist you can try at some point.
1). Implement the height option either as a camera dependent effect or a global scene effect, could be useful in situations where you get lower into a level and things can foggier.
2). Instead of objects fading to a solid color, an option where they fade into the color values of a background scene or a skybox/skydome that has the option to ignore mist activated, this may look a bit nicer in games containing background scenes (no appearance of solid colors clipping out of the view range, more like fading into nothing)
3). A color/alpha ramp that could be used with the first two proposals, this could be useful in scenes where you have a background scene, the objects first fade into a solid color and then into the background scene itself.
I know some of these can be done with nodes, but if you’re using a lot of materials already, it would make setting these effects a lot quicker and may or may not even be faster.
Good ideas, but I’m not sure I can do these. What I mean is that fog is just standard OpenGL stuff - it’s not on a per-polygon or per-pixel basis, but the fog code is pretty much applied before drawing the screen, I think. I can’t change the fog color dynamically - I mean, it’s possible, but it would be easier (on small scenes) to just write a GLSL shader or use nodes, as you mentioned. It might be worth the idea, though, to include a GLSL shader that does this, much like the Lambert / Phong / Toon shaders are naturally included.
i have installed both tortoise svn and a command line svn
i use the command line svn for all the automatic process i do with batch, and tortoise for the things that have to be done once a while.
For creating a patch, right click on the source directory inside blender directory-> tortoiseSvn -> create patch. It will allow it to choose the files to include in the patch(it will automatically select the modified ones, but you’ll need to add the add ones), than press ok, save the file, and you are done. Usually the file is a .diff