mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 05:31:01 +00:00 
			
		
		
		
	lot of work on 2D lighting and isometric maps
added a new demo, isometric_light that does full isometric sorting, lights, shadows, etc.
This commit is contained in:
		
							parent
							
								
									2c2894ceb6
								
							
						
					
					
						commit
						09489e3a78
					
				
					 214 changed files with 1093 additions and 309 deletions
				
			
		|  | @ -3954,6 +3954,15 @@ void VisualServerRaster::canvas_light_set_item_mask(RID p_light, int p_mask){ | |||
| 
 | ||||
| } | ||||
| 
 | ||||
| void VisualServerRaster::canvas_light_set_item_shadow_mask(RID p_light, int p_mask){ | ||||
| 
 | ||||
| 	Rasterizer::CanvasLight *clight = canvas_light_owner.get(p_light); | ||||
| 	ERR_FAIL_COND(!clight); | ||||
| 	clight->item_shadow_mask=p_mask; | ||||
| 
 | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| void VisualServerRaster::canvas_light_set_subtract_mode(RID p_light, bool p_enable) { | ||||
| 
 | ||||
| 
 | ||||
|  | @ -4559,6 +4568,13 @@ void VisualServerRaster::free( RID p_rid ) { | |||
| 
 | ||||
| 		} | ||||
| 
 | ||||
| 		if (occluder->canvas.is_valid() && canvas_owner.owns(occluder->canvas)) { | ||||
| 
 | ||||
| 			Canvas *canvas = canvas_owner.get(occluder->canvas); | ||||
| 			canvas->occluders.erase(occluder); | ||||
| 
 | ||||
| 		} | ||||
| 
 | ||||
| 		canvas_light_occluder_owner.free( p_rid ); | ||||
| 		memdelete(occluder); | ||||
| 
 | ||||
|  | @ -6906,6 +6922,8 @@ void VisualServerRaster::_draw_viewport(Viewport *p_viewport,int p_ofs_x, int p_ | |||
| 		Rasterizer::CanvasLight *lights_with_shadow=NULL; | ||||
| 		Rect2 shadow_rect; | ||||
| 
 | ||||
| 		int light_count=0; | ||||
| 
 | ||||
| 		for (Map<RID,Viewport::CanvasData>::Element *E=p_viewport->canvas_map.front();E;E=E->next()) { | ||||
| 
 | ||||
| 			Matrix32 xf = p_viewport->global_transform * E->get().transform; | ||||
|  | @ -6944,10 +6962,13 @@ void VisualServerRaster::_draw_viewport(Viewport *p_viewport,int p_ofs_x, int p_ | |||
| 							cl->radius_cache=cl->rect_cache.size.length(); | ||||
| 
 | ||||
| 						} | ||||
| 
 | ||||
| 						light_count++; | ||||
| 					} | ||||
| 				} | ||||
| 			} | ||||
| 
 | ||||
| 			//print_line("lights: "+itos(light_count));
 | ||||
| 			canvas_map[ Viewport::CanvasKey( E->key(), E->get().layer) ]=&E->get(); | ||||
| 
 | ||||
| 		} | ||||
|  | @ -7007,7 +7028,7 @@ void VisualServerRaster::_draw_viewport(Viewport *p_viewport,int p_ofs_x, int p_ | |||
| 
 | ||||
| 		} | ||||
| 
 | ||||
| 		rasterizer->canvas_debug_viewport_shadows(lights_with_shadow); | ||||
| 		//rasterizer->canvas_debug_viewport_shadows(lights_with_shadow);
 | ||||
| 	} | ||||
| 
 | ||||
| 	//capture
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Juan Linietsky
						Juan Linietsky