NARCISITA – COMPULSIVA –DEPENDIENTE
IV. ACTIVIDADES PSICOTERAPEUTICAS
The interactive system is fully dynamic such that it allows the user to change camera view, object positions, object materials, lighting positions and lighting conditions while interacting with the scene. This interaction sets the scene state which the scheduler uses for queuing up the jobs. Before displaying a frame, the master needs to wait for the results to come back from the workers. It then reconstructs the partial frame on the GPU as explained further in Section 7.2.3.1, and displays it on the user’s screen. It is possible that the job queue contains jobs for a frame which has been already displayed and in such a case those jobs are discarded from the job queue.
A heuristic is used to guide the master to determine how long to wait for the results from the worker before reconstructing the partial frame. There are two parameters which form the heuristic, a quality constraint and an interaction constraint.
The quality constraint Qt, at a time instant t measured from the start of
computation for the current frame, is given by:
Qt= number of jobs finished for the current frame number of total jobs for the current frame
The quality constraint controls the visual quality of the reconstructed frame. The interaction constraint It, at a time instant t is given by:
It =
time taken for the current frame time taken for the last frame
The interaction constraint estimates the wait time using the previous frame and tries to maintain smooth user interaction even with variable computing resources. The master waits for time t while one of the following conditions is true:
Qt< Qmax ∧ It < Imin Qt< Qmin ∧ It < Imax
whereQmin,Qmax,Imin andImax are user-defined minimum and maximum values
7. Interactive Rendering on Desktop Grids 96
if the master does not receive results to meet the minimum quality constraint in the time specified by maximum interaction constraint, it skips the current frame and moves on to the next frame. This ensures that even if most of the workers computing the same frame go down, the master would be able to adjust to this significant transient variation in the compute power.
If the user requires a fixed frame rate, the master waits for the specified amount of time before moving onto reconstruction. In this case, the recon- struction tackles the variability of resources and the visual quality of the frames changes.
7.2.3.1 Image Reconstruction
While rendering using volatile resources, some results may not be received due to faults. Therefore, image reconstruction techniques need to be employed to fill in the missing pixels in a partial frame. A discontinuity function,Di,j is used to find
if two pixels iand j are similar for interpolating across them. The discontinuity function is given by:
Di,j = max(0, ~ni·n~j −α)×max(0,|zi−zj|2−β2)
where,
~
ni = Orientation at pixel i
α = User-defined orientation threshold
zi = Position at pixel i
β = User-defined position threshold
This discontinuity function can be used as a spatial discontinuity filter when
i and j are different in spatial positions, and it can also be used as a temporal discontinuity filter when i and j represent same pixel in different frames.
Firstly, a nearest neighbour reconstruction technique is used to estimate the missing pixels. This technique is chosen over other reconstruction methods due to its simplicity and the ability to run in real-time on a GPU. The luminanceLi, of a missing pixel i is calculated as:
Li = X j∈N{i} Lj×Di,j×ki,j X j∈N{i} Di,j ×ki,j ∀i∈Ω
7. Interactive Rendering on Desktop Grids 97
where,
Li = Luminance at pixel i
N{i} = Set of calculated pixels in the neighbourhood
of i
Di,j = Spatial discontinuity function ki,j = User-defined weighting function
Ω = Set of all missing pixels
After nearest neighbour reconstruction, luminance values are accumulated and displayed if the scene state is unchanged from the previous frame. If this is not the case, then a temporal filter is applied to reduce flickering when user interaction occurs. The temporal discontinuity function removes the ghosting artefacts usually generated by a temporal filter and the luminance is updated as follows: Li = X j∈T{i} Lj ×Di,j ×wi,j X j∈T{i} Di,j ×wi,j ∀i∈Π where,
T{i} = Set containing previous values of pixel i
Di,j = Temporal discontinuity function wi,j = User-defined weighting function
Π = Set of all image pixels
Finally, the spatial noise due to low samples per pixel, while the user is interacting with the scene, is reduced by applying a Gaussian filter with spatial discontinuities . This filter is given by:
Li = X j∈M{i} Lj ×Di,j×gi,j X j∈M{i} Di,j×gi,j ∀i∈Π where, gi,j = e− i2+j2 2σ2 2πσ2
σ = Standard deviation of the Gaussian function
7. Interactive Rendering on Desktop Grids 98
This reconstruction and filtering is only done on the luminance values calcu- lated by the renderer, which does not contain the information about the albedo (surface colour of the material at the primary ray intersection that does not take into account any lighting). The albedo is calculated on the GPU and multi- plied afterwards. This prevents filtering across colour boundaries contained in the albedo such as high frequency texture details.