StaticPass: fix spot light
This commit is contained in:
		
							parent
							
								
									3f5cc4963e
								
							
						
					
					
						commit
						65b7c205f9
					
				| @ -156,11 +156,17 @@ public final class StaticPassLightingLogic extends DefaultTechniqueDefLogic { | |||||||
|             ColorRGBA color = light.getColor(); |             ColorRGBA color = light.getColor(); | ||||||
|             Vector3f pos = light.getPosition(); |             Vector3f pos = light.getPosition(); | ||||||
|             Vector3f dir = light.getDirection(); |             Vector3f dir = light.getDirection(); | ||||||
|  | 
 | ||||||
|  |             tempPosition.set(light.getPosition()); | ||||||
|  |             tempDirection.set(light.getDirection()); | ||||||
|  |             transformPosition(viewMatrix, tempPosition); | ||||||
|  |             transformDirection(viewMatrix, tempDirection); | ||||||
|  | 
 | ||||||
|             float invRange = light.getInvSpotRange(); |             float invRange = light.getInvSpotRange(); | ||||||
|             float spotAngleCos = light.getPackedAngleCos(); |             float spotAngleCos = light.getPackedAngleCos(); | ||||||
|             lightData.setVector4InArray(color.r, color.g, color.b, 1f, index++); |             lightData.setVector4InArray(color.r, color.g, color.b, 1f, index++); | ||||||
|             lightData.setVector4InArray(pos.x, pos.y, pos.z, invRange, index++); |             lightData.setVector4InArray(tempPosition.x, tempPosition.y, tempPosition.z, invRange, index++); | ||||||
|             lightData.setVector4InArray(dir.x, dir.y, dir.z, spotAngleCos, index++); |             lightData.setVector4InArray(tempDirection.x, tempDirection.y, tempDirection.z, spotAngleCos, index++); | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user