Skip to content
This repository was archived by the owner on May 3, 2026. It is now read-only.

Commit 0d4e4a1

Browse files
authored
Merge pull request #11 from Project-Collapse-Studios/psc-dev
Add DOF support for comp_visual_preset
2 parents d4a5cc6 + 936ecf7 commit 0d4e4a1

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

fgd/point/comp/comp_visual_preset.fgd

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,16 @@
3434
cc_fadein(float) : "CC FadeIn Time" : 1.0
3535
cc_fadeout(float) : "CC FadeOut Time" : 1.0
3636

37+
linedivider_fg[!engine](string) readonly : "----------------------------------------------------------------------------------------------------------" : ""
38+
39+
40+
dof_controller(target_destination) : "env_dof_controller" : "@DOFController" : "Depth of field controller. Needs to be set to use dof presets."
41+
dof_near_blur(float) : "Near blur depth" : 20 : "Distance that the blurriness is at its peak near the viewpoint."
42+
dof_near_focus(float) : "Near focus depth" : 100 : "Distance that the focus is in full effect near the viewpoint."
43+
dof_near_radius(float) : "Near blur radius" : 8 : "Radius (in pixels) to blur the surrounding pixels."
44+
dof_far_blur(float) : "Far blur depth" : 1000 : "Distance where blurriness is at its peak far from the viewpoint."
45+
dof_far_focus(float) : "Far focus depth" : 500 : "Distance that the focus is in full effect far from the viewpoint."
46+
dof_far_radius(float) : "Far blur radius" : 8 : "Radius (in pixels) to blur the surrounding pixels."
3747

3848
input Apply(void) : "Applies the preset, disables all other ones."
3949

transforms/comp_visual_preset.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,21 @@ def visual_preset(ctx: Context) -> None:
9393
Output("OnUser1", cc_ent, "Disable")
9494
)
9595

96+
97+
# Depth of Field
98+
99+
if (dof_controller := vpreset["dof_controller", None]):
100+
for _ in vmf.search(dof_controller):
101+
relay_ent.add_out(
102+
Output("OnTrigger", dof_controller, "SetNearBlurDepth", param=vpreset["dof_near_blur", 20]),
103+
Output("OnTrigger", dof_controller, "SetNearFocusDepth", param=vpreset["dof_near_focus", 100]),
104+
Output("OnTrigger", dof_controller, "SetFarFocusDepth", param=vpreset["dof_far_focus", 500]),
105+
Output("OnTrigger", dof_controller, "SetFarBlurDepth", param=vpreset["dof_far_blur", 1000]),
106+
Output("OnTrigger", dof_controller, "SetNearBlurRadius", param=vpreset["dof_near_radius", 8]),
107+
Output("OnTrigger", dof_controller, "SetFarBlurRadius", param=vpreset["dof_far_radius", 8])
108+
)
109+
break
110+
96111
# End loop
97112

98113

0 commit comments

Comments
 (0)