User Tools

Site Tools


monitor:jesse:near_eye_shader

/ca_pos

Near Eye Display Shader Breakdown

Pre-setup

\[colors=\begin{bmatrix} 0 \\ 0 \\ 0 \end{bmatrix}\]

Available Variables

  • FragCoord: x, y, and z coordinates of the pixel. We ignore the depth.
  • Interaction Period: calculated from interactionLength. Not sure what either represents. Needs units/context.
  • laserTrigger parameters
    • enable
    • amplitude
    • width (I'm assuming this is in pixel clocks = 1/400MHz)

Index

Either just the x coordinate, or x coordinate calculated with row count for time coherence.

int index_modulo = index - ( index / interactionPeriod )* interactionPeriod; 

First off, the original index value is useless, because all we actually care about is this, which is $$index \mod interactionPeriod$$, our index within one period. We could replace this with

index_modulo = mod(index,interactionPeriod)

for clarity.

RF Segments

Blue

This is just the laser trigger. \[blue = ampl_{trigger} \cdot (index_{mod} \lt width_{trigger} \land enable_{trigger})\] Easy enough.

Discrete Segments

In this mode, we run on red only. For each segment that's active:

  • If: $$(begin_{seg} \le index_{modulo} \lt end_{seg}) \lor (begin_{seg} + T_{interaction} \le index_{modulo} \lt end_{seg} + T_{interaction})$$
    • $$val_i=cos(index_{modulo} \cdot k_i )$$
  • $$red = (\frac{1}{N_{segments}}\sum_{i=1}^{N_{segments}}val_i)\cdot\frac{1}{2}+\frac{1}{2}$$

Continuous Chirp

Red
Green

Same as red, but using the chirp_freq<dir>_1 set.

Arctan Chirp

Precalculates along segment length. For each x in segment length 'n', \[\theta=\frac{atan2(n-x,focus)}{\pi}+.5 \\ f = \theta*(f_l-f_r)+f_r \\ kx = f\cdot \frac{\pi}{\beta_{GPU}}\]

monitor/jesse/near_eye_shader.txt · Last modified: 2018/10/31 11:47 by jclds139