abramped / gamekit

Automatically exported from code.google.com/p/gamekit
0 stars 0 forks source link

Custom GLSL Shaders support #119

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
While the Blender built-in glsl system may be clunky to port over, the ability 
of having custom shaders is really important in my opinion.

In Blender/BGE the better reference to use is the work from Mitchell Stokes 
(moguri) in his  2010 gsoc branch. This is likely to be merged after Blender 
2.6 is out (and features are unfrozen again).

That includes the ability of adding custom individual shaders (frag, vert, 
geom.) per material [1] or per object [2]. Also to access some object built-in 
uniforms in the shader (e.g. diffuse-color, alpha) [1]

[1] http://wiki.blender.org/index.php/User:Moguri/GSoC_Shaders_Docs
[2] http://lists.blender.org/pipermail/bf-blender-cvs/2010-October/031817.html

Original issue reported on code.google.com by dfeli...@gmail.com on 23 Nov 2010 at 8:49

GoogleCodeExporter commented 9 years ago
This kind of functionality is already possible although you must use Ogre 
directly. The current GLSL system in blender is indeed not trivial to port, 
specially given the fact that ideally it should work with Direct3D. Once this 
feature is in Blender I think it will be much more simple/flexible/optimized 
and also easier to load into Gamekit and pass to the render engine.

Original comment by xavier.thomas.1980@gmail.com on 23 Nov 2010 at 9:57

GoogleCodeExporter commented 9 years ago
Hi, can you give a few hints as to how to apply a shader in the OgreKit?  And 
yes, a lot of Blender's material shader is designed to mimic the renderer, and 
not for maximum speed.

Original comment by mike.c.pan on 23 Nov 2010 at 10:03

GoogleCodeExporter commented 9 years ago
You will have to load a material from a Ogre script. There is plenty of doc 
regarding this on the Ogre wiki. The runtime demo blend file (momo_ogre.blend) 
use such a script (CustomMat.material text block in Blender's text editor) for 
the ground and world materials.

Have fun.

Original comment by xavier.thomas.1980@gmail.com on 23 Nov 2010 at 10:54

GoogleCodeExporter commented 9 years ago
Xavier, even if the data is not (yet) stored in official Blender files the API 
could come handy (a Lua binding for that). One thing I have no idea about is if 
GLSL and HSLS handle uniforms differently.

Original comment by dfeli...@gmail.com on 23 Nov 2010 at 10:55

GoogleCodeExporter commented 9 years ago
Thanks for the embedded shader update and sample! I'll test it out soon. Take 
care. ike

Original comment by somedolp...@gmail.com on 24 Nov 2010 at 12:34