Make objects in between player and camera lower alpha value

Make objects in between player and camera lower alpha value

there is a visual debugger so you can see where the inital camera ray is hitting as well as a second ray visulizer
so you can see if the recast is hitting,

let me know if you run into any trouble adapting it,

it’s pretty lean on logic, but let me know if you think of a way to improve it.

Attachments

AlphaLogicWithRecast.blend (495 KB)

Hello! That’s fine! But the only disadvantage is that you use object color. And you can’t use it when you have a mesh with multiple materials. However, you can use alpha Blending with a bit of GLSL (http://en.wikibooks.org/wiki/GLSL_Programming/Blender/Transparency):

http://www.blender.org/api/blender_python_api_2_72b_release/bge.types.KX_BlenderMaterial.html?highlight=setblending#bge.types.KX_BlenderMaterial.setBlending

I made a little example without specular reflections and without textures (mouse wheel to set alpha):

http://www.pasteall.org/blend/33100

But the disadvantage of this method is that the GLSL shader replaces your Blender material (you have to set emission in the material tab to a value != 0 (because diffuse in GLSL is computed with material.emission…)

Have a nice day!

I like the ray re-casting. I think the effect would look a lot better, were the alpha interpolated for a transition effect. Nice work, BPR :slight_smile:

Thank you MrPutuLips :smiley: