Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
haxiomic committed Jun 30, 2020
1 parent b6e2a5a commit b2b18d8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions examples/custom-signal-shading/src/CustomSignalTrack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,29 @@ import { SignalTile, SignalTrack, Shaders, SignalTrackModel, TrackModel, SignalT

export class CustomSignalTrack extends SignalTrack {

constructor(model: SignalTrackModel) {
super({ ...model });
this.customTileNodeClass = CustomSignalTile;
}
constructor(model: SignalTrackModel) {
super({ ...model });
this.customTileNodeClass = CustomSignalTile;
}

}

class CustomSignalTile extends SignalTile {

protected signalShaderFunction = `
protected signalShaderFunction = `
// import the viridis color palette function
// vec3 viridis( float x )
${Shaders.functions.palettes.viridis}
// this function returns the signal image given signal values from the texture
vec4 signalRGBA(vec4 data) {
// this function returns the signal image given signal values from the texture
vec4 signalRGBA(vec4 data) {
float normalizedSignalValue = data.x;
float signalMask = antialiasedSignalAlpha(normalizedSignalValue); // to use as alpha channel
vec3 signalColor = viridis(normalizedSignalValue); // generate a color from the signal value
return vec4(signalColor, signalMask);
}
`;
}
`;

}

0 comments on commit b2b18d8

Please sign in to comment.