mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 14:11:15 +00:00
Add Cone and Cylinder shapes to FogVolume
This complements the existing Ellipsoid and Box local fog shapes. This can be used to represent a light cone coming from a SpotLight.
This commit is contained in:
parent
1c99b7415f
commit
e85459dcd1
8 changed files with 49 additions and 12 deletions
|
|
@ -4365,7 +4365,8 @@ void RendererSceneRenderRD::_update_volumetric_fog(RID p_render_buffers, RID p_e
|
|||
RS::FogVolumeShape volume_type = storage->fog_volume_get_shape(fog_volume);
|
||||
Vector3 extents = storage->fog_volume_get_extents(fog_volume);
|
||||
|
||||
if (volume_type == RS::FOG_VOLUME_SHAPE_BOX || volume_type == RS::FOG_VOLUME_SHAPE_ELLIPSOID) {
|
||||
if (volume_type != RS::FOG_VOLUME_SHAPE_WORLD) {
|
||||
// Local fog volume.
|
||||
Vector3i points[8];
|
||||
points[0] = _point_get_position_in_froxel_volume(fog_volume_instance->transform.xform(Vector3(extents.x, extents.y, extents.z)), fog_end, fog_near_size, fog_far_size, env->volumetric_fog_detail_spread, Vector3(rb->volumetric_fog->width, rb->volumetric_fog->height, rb->volumetric_fog->depth), p_cam_transform);
|
||||
points[1] = _point_get_position_in_froxel_volume(fog_volume_instance->transform.xform(Vector3(-extents.x, extents.y, extents.z)), fog_end, fog_near_size, fog_far_size, env->volumetric_fog_detail_spread, Vector3(rb->volumetric_fog->width, rb->volumetric_fog->height, rb->volumetric_fog->depth), p_cam_transform);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue