| 
									
										
										
										
											2017-02-07 11:20:15 +01:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright 2016, Blender Foundation. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * 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. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Contributor(s): Blender Institute | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-08 20:00:09 +01:00
										 |  |  | /** \file draw_common.h
 | 
					
						
							| 
									
										
										
										
											2017-02-07 11:20:15 +01:00
										 |  |  |  *  \ingroup draw | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-08 20:00:09 +01:00
										 |  |  | #ifndef __DRAW_COMMON__
 | 
					
						
							|  |  |  | #define __DRAW_COMMON__
 | 
					
						
							| 
									
										
										
										
											2017-02-07 11:20:15 +01:00
										 |  |  | 
 | 
					
						
							|  |  |  | struct DRWPass; | 
					
						
							| 
									
										
										
										
											2017-03-08 20:00:09 +01:00
										 |  |  | struct DRWShadingGroup; | 
					
						
							| 
									
										
										
										
											2017-02-07 11:20:15 +01:00
										 |  |  | struct Batch; | 
					
						
							|  |  |  | struct Object; | 
					
						
							| 
									
										
										
										
											2017-03-21 17:47:22 +01:00
										 |  |  | struct SceneLayer; | 
					
						
							| 
									
										
										
										
											2017-02-07 11:20:15 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-01 18:54:58 +01:00
										 |  |  | /* Used as ubo but colors can be directly
 | 
					
						
							|  |  |  |  * referenced as well */ | 
					
						
							|  |  |  | /* Keep in sync with globalsBlock in shaders */ | 
					
						
							|  |  |  | typedef struct GlobalsUboStorage { | 
					
						
							|  |  |  | 	/* UBOs data needs to be 16 byte aligned (size of vec4) */ | 
					
						
							|  |  |  | 	float colorWire[4]; | 
					
						
							|  |  |  | 	float colorWireEdit[4]; | 
					
						
							|  |  |  | 	float colorActive[4]; | 
					
						
							|  |  |  | 	float colorSelect[4]; | 
					
						
							|  |  |  | 	float colorTransform[4]; | 
					
						
							|  |  |  | 	float colorGroupActive[4]; | 
					
						
							| 
									
										
										
										
											2017-04-10 22:23:33 +02:00
										 |  |  | 	float colorGroupSelect[4]; | 
					
						
							| 
									
										
										
										
											2017-03-01 18:54:58 +01:00
										 |  |  | 	float colorGroup[4]; | 
					
						
							|  |  |  | 	float colorLamp[4]; | 
					
						
							|  |  |  | 	float colorSpeaker[4]; | 
					
						
							|  |  |  | 	float colorCamera[4]; | 
					
						
							|  |  |  | 	float colorEmpty[4]; | 
					
						
							|  |  |  | 	float colorVertex[4]; | 
					
						
							|  |  |  | 	float colorVertexSelect[4]; | 
					
						
							|  |  |  | 	float colorEditMeshActive[4]; | 
					
						
							|  |  |  | 	float colorEdgeSelect[4]; | 
					
						
							|  |  |  | 	float colorEdgeSeam[4]; | 
					
						
							|  |  |  | 	float colorEdgeSharp[4]; | 
					
						
							|  |  |  | 	float colorEdgeCrease[4]; | 
					
						
							|  |  |  | 	float colorEdgeBWeight[4]; | 
					
						
							|  |  |  | 	float colorEdgeFaceSelect[4]; | 
					
						
							|  |  |  | 	float colorFace[4]; | 
					
						
							|  |  |  | 	float colorFaceSelect[4]; | 
					
						
							|  |  |  | 	float colorNormal[4]; | 
					
						
							|  |  |  | 	float colorVNormal[4]; | 
					
						
							|  |  |  | 	float colorLNormal[4]; | 
					
						
							|  |  |  | 	float colorFaceDot[4]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	float colorDeselect[4]; | 
					
						
							|  |  |  | 	float colorOutline[4]; | 
					
						
							|  |  |  | 	float colorLampNoAlpha[4]; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-22 21:28:59 +01:00
										 |  |  | 	float colorBackground[4]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	float colorGrid[4]; | 
					
						
							|  |  |  | 	float colorGridEmphasise[4]; | 
					
						
							|  |  |  | 	float colorGridAxisX[4]; | 
					
						
							|  |  |  | 	float colorGridAxisY[4]; | 
					
						
							|  |  |  | 	float colorGridAxisZ[4]; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-01 18:54:58 +01:00
										 |  |  | 	/* Pack individual float at the end of the buffer to avoid alignement errors */ | 
					
						
							|  |  |  | 	float sizeLampCenter, sizeLampCircle, sizeLampCircleShadow; | 
					
						
							| 
									
										
										
										
											2017-03-09 01:29:04 +01:00
										 |  |  | 	float sizeVertex, sizeEdge, sizeEdgeFix, sizeFaceDot; | 
					
						
							| 
									
										
										
										
											2017-03-22 21:28:59 +01:00
										 |  |  | 	float gridDistance, gridResolution, gridSubdivisions, gridScale; | 
					
						
							| 
									
										
										
										
											2017-03-01 18:54:58 +01:00
										 |  |  | } GlobalsUboStorage; | 
					
						
							|  |  |  | /* Keep in sync with globalsBlock in shaders */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-08 20:00:09 +01:00
										 |  |  | void DRW_globals_update(void); | 
					
						
							| 
									
										
										
										
											2017-03-01 18:54:58 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-08 20:00:09 +01:00
										 |  |  | struct DRWShadingGroup *shgroup_dynlines_uniform_color(struct DRWPass *pass, float color[4]); | 
					
						
							|  |  |  | struct DRWShadingGroup *shgroup_dynpoints_uniform_color(struct DRWPass *pass, float color[4], float *size); | 
					
						
							|  |  |  | struct DRWShadingGroup *shgroup_groundlines_uniform_color(struct DRWPass *pass, float color[4]); | 
					
						
							|  |  |  | struct DRWShadingGroup *shgroup_groundpoints_uniform_color(struct DRWPass *pass, float color[4]); | 
					
						
							|  |  |  | struct DRWShadingGroup *shgroup_instance_screenspace(struct DRWPass *pass, struct Batch *geom, float *size); | 
					
						
							|  |  |  | struct DRWShadingGroup *shgroup_instance_objspace_solid(struct DRWPass *pass, struct Batch *geom, float (*obmat)[4]); | 
					
						
							|  |  |  | struct DRWShadingGroup *shgroup_instance_objspace_wire(struct DRWPass *pass, struct Batch *geom, float (*obmat)[4]); | 
					
						
							| 
									
										
										
										
											2017-04-10 22:22:37 +02:00
										 |  |  | struct DRWShadingGroup *shgroup_instance_screen_aligned(struct DRWPass *pass, struct Batch *geom); | 
					
						
							| 
									
										
										
										
											2017-03-08 20:00:09 +01:00
										 |  |  | struct DRWShadingGroup *shgroup_instance_axis_names(struct DRWPass *pass, struct Batch *geom); | 
					
						
							| 
									
										
										
										
											2017-04-10 22:22:37 +02:00
										 |  |  | struct DRWShadingGroup *shgroup_instance_scaled(struct DRWPass *pass, struct Batch *geom); | 
					
						
							| 
									
										
										
										
											2017-03-08 20:00:09 +01:00
										 |  |  | struct DRWShadingGroup *shgroup_instance(struct DRWPass *pass, struct Batch *geom); | 
					
						
							|  |  |  | struct DRWShadingGroup *shgroup_camera_instance(struct DRWPass *pass, struct Batch *geom); | 
					
						
							|  |  |  | struct DRWShadingGroup *shgroup_distance_lines_instance(struct DRWPass *pass, struct Batch *geom); | 
					
						
							|  |  |  | struct DRWShadingGroup *shgroup_spot_instance(struct DRWPass *pass, struct Batch *geom); | 
					
						
							| 
									
										
										
										
											2017-02-07 11:20:15 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-21 17:47:22 +01:00
										 |  |  | int DRW_object_wire_theme_get(struct Object *ob, struct SceneLayer *sl, float **color); | 
					
						
							| 
									
										
										
										
											2017-04-10 22:22:37 +02:00
										 |  |  | float *DRW_color_background_blend_get(int theme_id); | 
					
						
							| 
									
										
										
										
											2017-02-07 11:20:15 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-08 20:00:09 +01:00
										 |  |  | /* draw_armature.c */ | 
					
						
							|  |  |  | void DRW_shgroup_armature_object( | 
					
						
							| 
									
										
										
										
											2017-03-21 17:47:22 +01:00
										 |  |  |     struct Object *ob, struct SceneLayer *sl, struct DRWPass *pass_bone_solid, | 
					
						
							| 
									
										
										
										
											2017-03-08 20:00:09 +01:00
										 |  |  |     struct DRWPass *pass_bone_wire, struct DRWShadingGroup *shgrp_relationship_lines); | 
					
						
							| 
									
										
										
										
											2017-02-22 13:00:15 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-08 20:00:09 +01:00
										 |  |  | void DRW_shgroup_armature_pose( | 
					
						
							|  |  |  |     struct Object *ob, struct DRWPass *pass_bone_solid, | 
					
						
							|  |  |  |     struct DRWPass *pass_bone_wire, struct DRWShadingGroup *shgrp_relationship_lines); | 
					
						
							| 
									
										
										
										
											2017-02-22 13:00:15 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-08 20:00:09 +01:00
										 |  |  | void DRW_shgroup_armature_edit( | 
					
						
							|  |  |  |     struct Object *ob, struct DRWPass *pass_bone_solid, | 
					
						
							|  |  |  |     struct DRWPass *pass_bone_wire, struct DRWShadingGroup *shgrp_relationship_lines); | 
					
						
							| 
									
										
										
										
											2017-02-22 13:00:15 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-08 20:00:09 +01:00
										 |  |  | #endif /* __DRAW_COMMON__ */
 |