[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11495] branches/soc-2007-mosani/source/ blender/render: Replaced R.{something} with (G.renderAPI_toggle ? RDB. something : R.something).
Aaron Moore
two.a.ron at gmail.com
Sun Aug 5 23:07:02 CEST 2007
Revision: 11495
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11495
Author: mosani
Date: 2007-08-05 23:07:02 +0200 (Sun, 05 Aug 2007)
Log Message:
-----------
Replaced R.{something} with (G.renderAPI_toggle ? RDB.something : R.something).
Not quite that simple, but that's the idea. I also verified that everything
still works as it did before with the toggle off and on.
Modified Paths:
--------------
branches/soc-2007-mosani/source/blender/render/intern/include/renderdatabase.h
branches/soc-2007-mosani/source/blender/render/intern/source/imagetexture.c
branches/soc-2007-mosani/source/blender/render/intern/source/pipeline.c
branches/soc-2007-mosani/source/blender/render/intern/source/pixelblending.c
branches/soc-2007-mosani/source/blender/render/intern/source/pixelshading.c
branches/soc-2007-mosani/source/blender/render/intern/source/ray.c
branches/soc-2007-mosani/source/blender/render/intern/source/rendercore.c
branches/soc-2007-mosani/source/blender/render/intern/source/shadbuf.c
branches/soc-2007-mosani/source/blender/render/intern/source/shadeinput.c
branches/soc-2007-mosani/source/blender/render/intern/source/shadeoutput.c
branches/soc-2007-mosani/source/blender/render/intern/source/texture.c
branches/soc-2007-mosani/source/blender/render/intern/source/zbuf.c
branches/soc-2007-mosani/source/blender/render/render_api/source/RND_internal.c
branches/soc-2007-mosani/source/blender/render/render_api/source/RND_pass.c
Added Paths:
-----------
branches/soc-2007-mosani/source/blender/render/intern/source/RND_convertblender.c
Removed Paths:
-------------
branches/soc-2007-mosani/source/blender/render/intern/source/RND_converblender.c
Modified: branches/soc-2007-mosani/source/blender/render/intern/include/renderdatabase.h
===================================================================
--- branches/soc-2007-mosani/source/blender/render/intern/include/renderdatabase.h 2007-08-05 20:01:30 UTC (rev 11494)
+++ branches/soc-2007-mosani/source/blender/render/intern/include/renderdatabase.h 2007-08-05 21:07:02 UTC (rev 11495)
@@ -207,5 +207,7 @@
void render_database_add_lamp( RenderDatabase *database, RNDObject object );
void render_database_insert_polygon_mesh( RenderDatabase *database, RNDObject object );
+void render_database_test_print( Render *render, RenderDatabase *database );
+
#endif /* RENDERDATABASE_H */
Deleted: branches/soc-2007-mosani/source/blender/render/intern/source/RND_converblender.c
===================================================================
--- branches/soc-2007-mosani/source/blender/render/intern/source/RND_converblender.c 2007-08-05 20:01:30 UTC (rev 11494)
+++ branches/soc-2007-mosani/source/blender/render/intern/source/RND_converblender.c 2007-08-05 21:07:02 UTC (rev 11495)
@@ -1,569 +0,0 @@
-/*
- * RND_converblender.c
- *
- * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. The Blender
- * Foundation also sells licenses for use in proprietary software under
- * the Blender License. See http://www.blender.org/BL/ for information
- * about this.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- *
- * The Original Code is Copyright (C) 2007 Blender Foundation
- *
- * Contributor(s): Aaron Moore (mosani)
- *
- * ***** END GPL/BL DUAL LICENSE BLOCK *****
- */
-
-/**
- * @file RND_converblender.c
- *
- * The file uses the render api to fill the RenderDatabase
- * structure from a blender scene.
- */
-
-/*
- * Includes
- */
-
-/* Copied From convertblender.c
- * it may be good to weed out the unnecessary
- * includes from here at some point. */
-#include <math.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <limits.h>
-
-#include "blendef.h"
-#include "MTC_matrixops.h"
-
-#include "MEM_guardedalloc.h"
-
-#include "BLI_arithb.h"
-#include "BLI_blenlib.h"
-#include "BLI_rand.h"
-#include "BLI_memarena.h"
-#include "BLI_ghash.h"
-
-#include "DNA_armature_types.h"
-#include "DNA_camera_types.h"
-#include "DNA_material_types.h"
-#include "DNA_curve_types.h"
-#include "DNA_effect_types.h"
-#include "DNA_group_types.h"
-#include "DNA_lamp_types.h"
-#include "DNA_image_types.h"
-#include "DNA_lattice_types.h"
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_meta_types.h"
-#include "DNA_object_types.h"
-#include "DNA_object_force.h"
-#include "DNA_object_fluidsim.h"
-#include "DNA_scene_types.h"
-#include "DNA_texture_types.h"
-#include "DNA_view3d_types.h"
-
-#include "BKE_anim.h"
-#include "BKE_armature.h"
-#include "BKE_action.h"
-#include "BKE_curve.h"
-#include "BKE_customdata.h"
-#include "BKE_constraint.h"
-#include "BKE_displist.h"
-#include "BKE_deform.h"
-#include "BKE_DerivedMesh.h"
-#include "BKE_effect.h"
-#include "BKE_global.h"
-#include "BKE_group.h"
-#include "BKE_key.h"
-#include "BKE_ipo.h"
-#include "BKE_image.h"
-#include "BKE_lattice.h"
-#include "BKE_library.h"
-#include "BKE_material.h"
-#include "BKE_main.h"
-#include "BKE_mball.h"
-#include "BKE_mesh.h"
-#include "BKE_node.h"
-#include "BKE_object.h"
-#include "BKE_scene.h"
-#include "BKE_subsurf.h"
-#include "BKE_texture.h"
-#include "BKE_utildefines.h"
-#include "BKE_world.h"
-
-#include "PIL_time.h"
-#include "IMB_imbuf_types.h"
-
-#include "envmap.h"
-#include "multires.h"
-#include "render_types.h"
-#include "rendercore.h"
-#include "renderdatabase.h"
-#include "renderpipeline.h"
-#include "radio.h"
-#include "shadbuf.h"
-#include "shading.h"
-#include "texture.h"
-#include "sss.h"
-#include "zbuf.h"
-
-#ifndef DISABLE_YAFRAY /* disable yafray */
-#include "YafRay_Api.h"
-#endif /* disable yafray */
-/* End Copied From convertblender.c */
-
-#include "renderdatabase.h"
-
-/* helper prototypes */
-static struct VlakRen *render_database_findOrAddVlak( RenderDatabase *db, int nr );
-static struct VertRen *render_database_findOrAddVert( RenderDatabase *db, int nr );
-static void render_database_free_renderdata_tables( RenderDatabase *db );
-static void render_database_free_parts( RenderDatabase *db );
-static void render_database_initialize_parts( RenderDatabase *db, RNDScene scene );
-
-void render_database_from_scene( RenderDatabase *db, RNDScene scene )
-{
- /* variables */
- RNDObject object;
-
- /* empty database */
- memset( db, 0, sizeof(RenderDatabase) );
- db->memArena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE);
- /*db->totvlak = db->totvert = db->totlamp = db->tothalo = 0;
- db->lights.first = db->lights.last = NULL; due to memset call all
- db->lampren.first = db->lampren.last = NULL; of this does nothing */
-
- /* loop through all objects */
- object = RND_get_objects( scene, RND_ALL );
- for( ; RND_object_exists( object ); RND_object_next( object ) )
- {
- switch( RND_object_get_type(object) )
- {
- case RND_LIGHT_POINT:
- render_database_add_lamp( db, object );
- break;
- case RND_GEOMETRY_POLYGON_MESH:
- render_database_insert_polygon_mesh( db, object );
- break;
- default: break;
- }
- }
-
- /* set render settings */
- db->winx = RND_get_image_width( scene );
- db->winy = RND_get_image_height( scene );
-
- db->disprect.xmin = 0;
- db->disprect.ymin = 0;
- db->disprect.xmax = RND_get_image_width( scene );
- db->disprect.ymax = RND_get_image_height( scene );
-
- db->rectx = RND_get_image_width( scene );
- db->recty = RND_get_image_height( scene );
-
- /* fill RenderData */
- db->r.osa = RND_get_pixel_filter_sample_number( scene );
-
- /* initialize parts */
- render_database_initialize_parts( db, scene );
-}
-void render_database_free( RenderDatabase *db )
-{
- LampRen *lar;
-
- /* free render lamps */
- for(lar= db->lampren.first; lar; lar= lar->next) {
- freeshadowbuf(lar);
- if(lar->jitter) MEM_freeN(lar->jitter);
- if(lar->shadsamp) MEM_freeN(lar->shadsamp);
- }
- BLI_freelistN(&db->lampren);
- BLI_freelistN(&db->lights);
-
- /* free render verticies and faces */
- render_database_free_renderdata_tables( db );
-
- db->totvlak = db->totvert = db->totlamp = db->tothalo = 0;
-
- /* free memory arena */
- if(db->memArena) {
- BLI_memarena_free(db->memArena);
- db->memArena = NULL;
- }
-
- /* free render parts */
- render_database_free_parts( db );
-}
-
-void render_database_add_lamp( RenderDatabase *database, RNDObject object )
-{
- RNDLight light;
- LampRen *render_lamp;
- GroupObject *group_object;
- float color[3];
-
-
- /*----------------------------------------
- Create Lamp Database Structures.
- ----------------------------------------*/
-
- render_lamp = MEM_callocN( sizeof(LampRen), "render lamp" );
-
- /* groups is used to unify support for lightgroups,
- * this is the global lightgroup,
- * also,
- * lamprens are in own list, for freeing */
- group_object = MEM_callocN( sizeof(GroupObject), "group object" );
- group_object->lampren = render_lamp;
-
- BLI_addtail( &database->lights, group_object );
- BLI_addtail( &database->lampren, render_lamp );
-
-
- /*----------------------------------------
- Fill Lamp Database Structures
- ----------------------------------------*/
-
- database->totlamp++;
- light = RND_object_get_light( object );
-
- /***** transformation information *****/
- RND_object_get_translation( object, render_lamp->co );
-
- /***** general light properties *****/
- render_lamp->energy = RND_light_get_intensity( light );
-
- render_lamp->dist = RND_light_get_falloff_distance( light );
- render_lamp->distkw = render_lamp->dist * render_lamp->dist;
-
- RND_light_get_color( light, color );
- render_lamp->r = color[0] * render_lamp->energy;
- render_lamp->g = color[1] * render_lamp->energy;
- render_lamp->b = color[2] * render_lamp->energy;
-}
-
-void render_database_insert_polygon_mesh( RenderDatabase *database, RNDObject object )
-{
- RNDGeometry geometry;
- RNDVertex vertex;
- RNDFace face;
- RNDIndex index;
- VertRen *render_vertex, **vertren_ptr;
- VlakRen *render_face;
- float object_matrix[4][4], normal_length;
- int i, total_verticies, vertex_offset;
-
- geometry = RND_object_get_geometry( object );
- RND_object_get_transformation( object, object_matrix );
-
- /**** Add Render Verticies ****/
-
- vertex = RND_geometry_get_vertices( geometry );
- for( ; RND_vertex_exists( vertex ); RND_vertex_next( vertex ) )
- {
- render_vertex = render_database_findOrAddVert( database, database->totvert++ );
- RND_vertex_get_coordinates( vertex, render_vertex->co );
- MTC_Mat4MulVecfl( object_matrix, render_vertex->co );
- }
-
- /*** Add Render Faces ****/
-
- /* some necessary setup - calculate an offset to help
- * in assigning VertRens to each VlakRen */
- total_verticies = RND_vertex_get_count( vertex );
- vertex_offset = database->totvert - total_verticies;
-
- face = RND_geometry_get_faces( geometry );
- for( ; RND_face_exists( face ); RND_face_next( face ) )
- {
- render_face = render_database_findOrAddVlak( database, database->totvlak++ );
-
- /* assign VertRens */
- index = RND_face_get_indices( face );
- for( i = 0; i < 4; i++, RND_index_next( index ) ){
- switch(i){
- case 0: vertren_ptr = &render_face->v1; break;
- case 1: vertren_ptr = &render_face->v2; break;
- case 2: vertren_ptr = &render_face->v3; break;
- case 3: vertren_ptr = &render_face->v4; break;
- }
- if( RND_index_exists( index ) )
- *vertren_ptr = render_database_findOrAddVert( database, vertex_offset+i );
- else *vertren_ptr = 0;
- }
-
- /* calculate normals */
- if( RND_face_get_index_count( face ) == 4 )
- normal_length = CalcNormFloat4( render_face->v4->co,
- render_face->v3->co,
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list