Guest User

Untitled

a guest
Apr 29th, 2018
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * AmbientOcclusionEffect - A screen space ambient occlusion implementation.
  3.  * Copyright 1998-2011 Epic Games, Inc. All Rights Reserved.
  4.  */
  5. class AmbientOcclusionEffect extends PostProcessEffect
  6.     native;
  7.  
  8. /** The color that will replace scene color where there is a lot of occlusion. */
  9. var(Color) interp LinearColor OcclusionColor;
  10.  
  11. /**
  12.  * Power to apply to the calculated occlusion value.
  13.  * Higher powers result in more contrast, but will need other factors like OcclusionScale to be tweaked as well.
  14.  */
  15. var(Color) float OcclusionPower <UIMin=0.1 | UIMax=20.0>;
  16.  
  17. /** Scale to apply to the calculated occlusion value. */
  18. var(Color) float OcclusionScale <UIMin=0.0 | UIMax=10.0>;
  19.  
  20. /** Bias to apply to the calculated occlusion value. */
  21. var(Color) float OcclusionBias <UIMin=-1.0 | UIMax=4.0>;
  22.  
  23. /** Minimum occlusion value after all other transforms have been applied. */
  24. var(Color) float MinOcclusion;
  25.  
  26. /** SSAO2 is SSAO with quality improvements, it is now the new method so the flag is no longer needed */
  27. var deprecated bool SSAO2;
  28.  
  29. /** SSAO quality improvements, less noise, more detail, no darkening of flat surfaces, no overbright on convex, parameter retweak needed */
  30. var(Occlusion) bool bAngleBasedSSAO;
  31.  
  32. /** Distance to check around each pixel for occluders, in world units. */
  33. var(Occlusion) float OcclusionRadius <UIMin=0.0 | UIMax=256.0>;
  34.  
  35. /** Attenuation factor that determines how much to weigh in samples based on distance, larger values result in a faster falloff over distance. */
  36. var deprecated float OcclusionAttenuation <UIMin=0.0 | UIMax=10.0>;
  37.  
  38. enum EAmbientOcclusionQuality
  39. {
  40.     AO_High,
  41.     AO_Medium,
  42.     AO_Low
  43. };
  44.  
  45. /**
  46.  * Quality of the ambient occlusion effect.  Low quality gives the best performance and is appropriate for gameplay.  
  47.  * Medium quality smooths noise between frames at a slightly higher performance cost.  High quality uses extra samples to preserve detail.
  48.  */
  49. var(Occlusion) EAmbientOcclusionQuality OcclusionQuality;
  50.  
  51. /**
  52.  * Distance at which to start fading out the occlusion factor, in world units.
  53.  * This is useful for hiding distant artifacts on skyboxes.
  54.  */
  55. var(Occlusion) float OcclusionFadeoutMinDistance;
  56.  
  57. /** Distance at which the occlusion factor should be fully faded, in world units. */
  58. var(Occlusion) float OcclusionFadeoutMaxDistance;
  59.  
  60. /**
  61.  * Distance in front of a pixel that an occluder must be to be considered a different object, in world units.  
  62.  * This threshold is used to identify halo regions around nearby objects, for example a first person weapon.
  63.  */
  64. var(Halo) float HaloDistanceThreshold;
  65.  
  66. /**
  67.  * Scale factor to increase HaloDistanceThreshold for distant pixels.  
  68.  * A value of .001 would result in HaloDistanceThreshold being 1 unit larger at a distance of 1000 world units.
  69.  */
  70. var(Halo) float HaloDistanceScale;
  71.  
  72. /**
  73.  * Occlusion factor to assign to samples determined to be contributing to a halo.  
  74.  * 0 would result in full occlusion for that sample, increasing values map to quadratically decreasing occlusion values.
  75.  */
  76. var(Halo) float HaloOcclusion;
  77.  
  78. /** Difference in depth that two pixels must be to be considered an edge, and therefore not blurred across, in world units. */
  79. var(Filter) float EdgeDistanceThreshold;
  80.  
  81. /**
  82.  * Scale factor to increase EdgeDistanceThreshold for distant pixels.  
  83.  * A value of .001 would result in EdgeDistanceThreshold being 1 unit larger at a distance of 1000 world units.
  84.  */
  85. var(Filter) float EdgeDistanceScale;
  86.  
  87. /**
  88.  * Distance in world units which should map to the kernel size in screen space.  
  89.  * This is useful to reduce filter kernel size for distant pixels and keep detail, at the cost of leaving more noise in the result.
  90.  */
  91. var(Filter) float FilterDistanceScale;
  92.  
  93. /** Size of the blur filter, in pixels. */
  94. var deprecated int FilterSize;
  95.  
  96. /**
  97.  * Time in which the occlusion history should approximately converge.  
  98.  * Longer times (.5s) allow more smoothing between frames and less noise but history streaking is more noticeable.
  99.  * 0 means the feature is off (less GPU performance and memory overhead)
  100.  */
  101. var(History) float HistoryConvergenceTime;
  102.  
  103. /**
  104.  * Time in which the weight history should approximately converge.  
  105.  */
  106. var float HistoryWeightConvergenceTime;
  107.  
  108. cpptext
  109. {
  110.     // UPostProcessEffect interface
  111.  
  112.     /**
  113.      * Creates a proxy to represent the render info for a post process effect
  114.      * @param WorldSettings - The world's post process settings for the view.
  115.      * @return The proxy object.
  116.      */
  117.     virtual class FPostProcessSceneProxy* CreateSceneProxy(const FPostProcessSettings* WorldSettings);
  118.  
  119.     /**
  120.      * @param View - current view
  121.      * @return TRUE if the effect should be rendered
  122.      */
  123.     virtual UBOOL IsShown(const FSceneView* View) const;
  124.  
  125.     virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent);
  126. }
  127.  
  128. defaultproperties
  129. {
  130.     bAffectsLightingOnly=TRUE
  131.     SceneDPG = SDPG_World;
  132.     OcclusionColor=(R=0.0,G=0.0,B=0.0,A=1.0)
  133.     OcclusionPower=4.0
  134.     OcclusionScale=20.0
  135.     OcclusionBias=0
  136.     MinOcclusion=.1
  137.     OcclusionRadius=25.0
  138.     OcclusionQuality=AO_Medium
  139.     OcclusionFadeoutMinDistance=4000.0
  140.     OcclusionFadeoutMaxDistance=4500.0
  141.     HaloDistanceThreshold=40.0
  142.     HaloDistanceScale=.1
  143.     HaloOcclusion=.04
  144.     EdgeDistanceThreshold=10.0
  145.     EdgeDistanceScale=.003
  146.     FilterDistanceScale=10.0
  147.     HistoryConvergenceTime=0
  148.     HistoryWeightConvergenceTime=.07
  149.     bAngleBasedSSAO=FALSE
  150. }
Add Comment
Please, Sign In to add comment