-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #137 from yt-project/matthewturk/issue135
Multiple views in a single window
- Loading branch information
Showing
6 changed files
with
176 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import yt | ||
|
||
import yt_idv | ||
from yt_idv.scene_components.particles import ParticleRendering | ||
from yt_idv.scene_data.particle_positions import ParticlePositions | ||
|
||
ds = yt.load_sample("IsolatedGalaxy") | ||
|
||
rc = yt_idv.render_context(height=800, width=800, gui=True) | ||
sg = rc.add_scene(ds, "density", no_ghost=True) | ||
|
||
sg.components[0].display_bounds = (0.0, 0.5, 0.0, 1.0) | ||
|
||
dd = ds.all_data() | ||
pos = ParticlePositions(data_source=dd) | ||
pren = ParticleRendering(data=pos) | ||
|
||
pren.display_bounds = (0.5, 1.0, 0.0, 1.0) | ||
|
||
sg.data_objects.append(pos) | ||
sg.components.append(pren) | ||
|
||
rc.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
in vec2 UV; | ||
|
||
out vec4 color; | ||
|
||
void main(){ | ||
color = texture(fb_tex, UV); | ||
color.a = 1.0; | ||
vec2 d = abs(UV - vec2(0.5)); | ||
if(0.5 - max(d.x, d.y) < draw_boundary) { | ||
color = vec4(boundary_color); | ||
} | ||
gl_FragDepth = texture(db_tex, UV).r; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.