Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(698)

Issue 4529098: Blender export GLSL shader patch

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 11 months ago by benoit.bolsee
Modified:
12 years, 11 months ago
Reviewers:
ideasman42, brechtvl
Base URL:
https://svn.blender.org/svnroot/bf-blender/trunk/blender/
Visibility:
Public.

Description

This patch adds the python module 'gpu' to blender with one method in it: export_shader(scene,material) to export the GLSL shader for use in an external game engine. The intention is to use this API in the X3D exporter to allow using the GLSL shader unchanged in the H3D game engine. The function export everything that's needed to use the shader. Documentation in http://www.pasteall.org/22048/text The patch modifies the GLSL library code by converting all 1D textures to 2D textures for compatibility with X3D. To keep it small, the patch does not include the modified source/blender/gpu/intern/gpu_shader_material.glsl.c You must run release/datafiles/datatoc.py source/blender/gpu/intern/gpu_shader_material.glsl after applying the patch to update the C version of the GLSL library.

Patch Set 1 #

Total comments: 2

Patch Set 2 : Fix lamp->object bug #

Patch Set 3 : Updated patch to SVN revision 38334 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+765 lines, -141 lines) Patch
source/blender/gpu/CMakeLists.txt View 1 2 2 chunks +11 lines, -0 lines 0 comments Download
source/blender/gpu/GPU_extensions.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
source/blender/gpu/GPU_material.h View 1 2 4 chunks +71 lines, -2 lines 0 comments Download
source/blender/gpu/GPU_python.h View 1 chunk +54 lines, -0 lines 0 comments Download
source/blender/gpu/SConscript View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
source/blender/gpu/intern/gpu_codegen.h View 1 2 2 chunks +114 lines, -1 line 0 comments Download
source/blender/gpu/intern/gpu_codegen.c View 1 2 10 chunks +23 lines, -101 lines 0 comments Download
source/blender/gpu/intern/gpu_extensions.c View 1 2 2 chunks +1 line, -12 lines 0 comments Download
source/blender/gpu/intern/gpu_material.c View 1 2 11 chunks +186 lines, -13 lines 0 comments Download
source/blender/gpu/intern/gpu_python.c View 1 1 chunk +285 lines, -0 lines 0 comments Download
source/blender/gpu/intern/gpu_shader_material.glsl View 1 2 3 chunks +12 lines, -12 lines 0 comments Download
source/blender/python/intern/bpy_interface.c View 1 2 2 chunks +3 lines, -0 lines 0 comments Download

Messages

Total messages: 3
benoit.bolsee
12 years, 11 months ago (2011-05-30 07:52:20 UTC) #1
ideasman42
commented minor issue of struct type which Im quite sure is incorrect from reading where ...
12 years, 11 months ago (2011-06-01 08:39:42 UTC) #2
benoit.bolsee
12 years, 11 months ago (2011-06-01 11:07:25 UTC) #3
http://codereview.appspot.com/4529098/diff/1/source/blender/gpu/GPU_material.h
File source/blender/gpu/GPU_material.h (right):

http://codereview.appspot.com/4529098/diff/1/source/blender/gpu/GPU_material....
source/blender/gpu/GPU_material.h:199: struct Lamp *lamp;				/* when
type=GPU_DYNAMIC_LAMP_... or GPU_DYNAMIC_SAMPLER_2DSHADOW */
On 2011/06/01 08:39:43, ideasman42 wrote:
> From using this patch, the type here is a lamp 'Object', but not lamp data.

Yes, you are perfectly right. Initially I used the Lamp datablock, then realized
that it was not sufficient to get the position uniforms and changed to lamp
object, but I forgot to change the structure. Updating new patch.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b