Skip to content
This repository has been archived by the owner on Sep 6, 2024. It is now read-only.

Commit

Permalink
Add Stereo (#47)
Browse files Browse the repository at this point in the history
* Add stereo

* Add STEREO-A
  • Loading branch information
dgarciabriseno authored Oct 5, 2022
1 parent 8101da8 commit 2d572d8
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class Config {
/**
* Sources IDs that should be rendered on a plane rather than a hemisphere
*/
this.plane_sources = [4, 5];
this.plane_sources = [4, 5, 28, 29];
}

/**
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ python3 -m http.server # runs on port 8000 by default
### Making Changes
Make sure to re-run `npx webpack` to update the js bundle whenever making javascript changes.

#### Adding a new Data Source
It *should* be easy to add a new data source. Just follow these 3 easy steps.

1. Add the new source as an option to the dropdown in index.html
2. Add the resolution of the base image size to `common/resolution_lookup.js`
3. If the image doesn't include the solar disk, but should be rendered on a plane, then add the source id to `Configuration.js`'s plane\_sources array.

If this doesn't work, please create a GitHub issue for assistance.

## Organization
Helios is made up of 6 major components

Expand Down
4 changes: 2 additions & 2 deletions Scene/three/model_builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ async function _GetBackside(texture, scale) {
y_offset: {value: 0.0},
backside: {value: true},
opacity: {value: 1},
transparent_threshold: {value: 0.15}
transparent_threshold: {value: 0.05}
},
vertexShader: SolarVertexShader,
fragmentShader: SolarFragmentShader
Expand Down Expand Up @@ -79,7 +79,7 @@ async function CreateHemisphereWithTexture(texture, jp2info) {
y_offset: {value: 0.0},
backside: {value: false},
opacity: {value: 1},
transparent_threshold: {value: 0.15}
transparent_threshold: {value: 0.05}
},
vertexShader: SolarVertexShader,
fragmentShader: SolarFragmentShader
Expand Down
4 changes: 4 additions & 0 deletions common/resolution_lookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ function _GetBaseImageResolution(source_id) {
} else if (_inclusive_between(source_id, 4, 5)) {
// SOHO LASCO images are 1024x1024 in size. These IDs are 4 and 5
return 1024;
} else if (_inclusive_between(source_id, 20, 23) || (source_id == 29)) {
return 2048;
} else if (_inclusive_between(source_id, 28, 29)) {
return 512;
} else {
// By default assume 4096. This may result in bad scaling if it's not correct.
console.log("Source ID " + source_id + " not defined in resolution lookup table, please notify the developers to add it.");
Expand Down
6 changes: 6 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
<option value="19">SDO HMI Mag</option>
<option value="4">SOHO LASCO C2</option>
<option value="5">SOHO LASCO C3</option>
<option value="20">STEREO-A EUVI-A 171</option>
<option value="21">STEREO-A EUVI-A 195</option>
<option value="22">STEREO-A EUVI-A 284</option>
<option value="23">STEREO-A EUVI-A 304</option>
<option value="28">STEREO-A COR1-A</option>
<option value="29">STEREO-A COR2-A</option>
</select>

<label for="js-resolution-selector">Texture Resolution</label>
Expand Down

0 comments on commit 2d572d8

Please sign in to comment.