Differential D15155 Diff 52389 source/blender/draw/engines/eevee_next/shaders/eevee_nodetree_lib.glsl
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/eevee_next/shaders/eevee_nodetree_lib.glsl
| Context not available. | |||||
| float x = weight / total_weight; | float x = weight / total_weight; | ||||
| bool chosen = (r < x); | bool chosen = (r < x); | ||||
| /* Assuming that if r is in the interval [0,x] or [x,1], it's still uniformly distributed within | /* Assuming that if r is in the interval [0,x] or [x,1], it's still uniformly distributed within | ||||
| * that interval, so you remaping to [0,1] again to explore this space of probability. */ | * that interval, so you remapping to [0,1] again to explore this space of probability. */ | ||||
| r = (chosen) ? (r / x) : ((r - x) / (1.0 - x)); | r = (chosen) ? (r / x) : ((r - x) / (1.0 - x)); | ||||
| return chosen; | return chosen; | ||||
| } | } | ||||
| Context not available. | |||||
| window.xy = vec2(0.5); | window.xy = vec2(0.5); | ||||
| } | } | ||||
| else { | else { | ||||
| /* TODO(fclem): Actual camera tranform. */ | /* TODO(fclem): Actual camera transform. */ | ||||
| window.xy = project_point(ViewProjectionMatrix, P).xy * 0.5 + 0.5; | window.xy = project_point(ViewProjectionMatrix, P).xy * 0.5 + 0.5; | ||||
| window.xy = window.xy * CameraTexCoFactors.xy + CameraTexCoFactors.zw; | window.xy = window.xy * CameraTexCoFactors.xy + CameraTexCoFactors.zw; | ||||
| } | } | ||||
| Context not available. | |||||