[yt-svn] commit/yt: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Thu Jun 2 11:26:27 PDT 2016
2 new commits in yt:
https://bitbucket.org/yt_analysis/yt/commits/a010e80c709a/
Changeset: a010e80c709a
Branch: yt
User: xarthisius
Date: 2016-05-26 19:33:20+00:00
Summary: Take into account texture clamping when calculating position in the texture space
Affected #: 4 files
diff -r f609b1cbd8dd18374c28cbd7511641b64438cd94 -r a010e80c709a6b3f82879f88c9a6311a93cf8371 .hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -45,9 +45,11 @@
yt/utilities/lib/mesh_intersection.cpp
yt/utilities/lib/mesh_samplers.cpp
yt/utilities/lib/mesh_traversal.cpp
+yt/utilities/lib/mesh_triangulation.c
yt/utilities/lib/mesh_utilities.c
yt/utilities/lib/misc_utilities.c
yt/utilities/lib/particle_mesh_operations.c
+yt/utilities/lib/primitives.c
yt/utilities/lib/origami.c
yt/utilities/lib/particle_mesh_operations.c
yt/utilities/lib/pixelization_routines.c
diff -r f609b1cbd8dd18374c28cbd7511641b64438cd94 -r a010e80c709a6b3f82879f88c9a6311a93cf8371 yt/visualization/volume_rendering/shaders/max_intensity.fragmentshader
--- a/yt/visualization/volume_rendering/shaders/max_intensity.fragmentshader
+++ b/yt/visualization/volume_rendering/shaders/max_intensity.fragmentshader
@@ -43,9 +43,14 @@
vec3 tex_curr_pos = vec3(0.0);
vec3 range = right_edge - left_edge;
+ // Take into account that texture is clamped
+ vec3 nds = range / dx;
+ vec3 tle = 1.0 / (2.0 * nds);
+ vec3 tre = 1.0 - tle;
+ vec3 tdd = tre - tle;
bool ray_in_bb = true;
while (ray_in_bb) {
- tex_curr_pos = (ray_position - left_edge)/range;
+ tex_curr_pos = tle + tdd * (ray_position - left_edge) / range;
vec3 tex_sample = texture(ds_tex, tex_curr_pos).rgb;
if (length(curr_color) < length(tex_sample)) {
diff -r f609b1cbd8dd18374c28cbd7511641b64438cd94 -r a010e80c709a6b3f82879f88c9a6311a93cf8371 yt/visualization/volume_rendering/shaders/projection.fragmentshader
--- a/yt/visualization/volume_rendering/shaders/projection.fragmentshader
+++ b/yt/visualization/volume_rendering/shaders/projection.fragmentshader
@@ -44,10 +44,15 @@
vec3 tex_curr_pos = vec3(0.0);
vec3 range = right_edge - left_edge;
bool ray_in_bb = true;
+ // Take into account that texture is clamped
+ vec3 nds = range / dx;
+ vec3 tle = 1.0 / (2.0 * nds);
+ vec3 tre = 1.0 - tle;
+ vec3 tdd = tre - tle;
float total_value = 0.0;
float color = 0.0;
while (ray_in_bb) {
- tex_curr_pos = (ray_position - left_edge) / range;
+ tex_curr_pos = tle + tdd * (ray_position - left_edge) / range;
vec3 tex_sample = texture(ds_tex, tex_curr_pos).rgb;
color = (tex_sample * length(step_size * dir)).r;
total_value += length(step_size * dir) * tex_sample.r;
diff -r f609b1cbd8dd18374c28cbd7511641b64438cd94 -r a010e80c709a6b3f82879f88c9a6311a93cf8371 yt/visualization/volume_rendering/shaders/transfer_function.fragmentshader
--- a/yt/visualization/volume_rendering/shaders/transfer_function.fragmentshader
+++ b/yt/visualization/volume_rendering/shaders/transfer_function.fragmentshader
@@ -48,8 +48,13 @@
vec3 range = right_edge - left_edge;
vec4 new_color;
bool ray_in_bb = true;
+ // Take into account that texture is clamped
+ vec3 nds = range / dx;
+ vec3 tle = 1.0 / (2.0 * nds);
+ vec3 tre = 1.0 - tle;
+ vec3 tdd = tre - tle;
while (ray_in_bb) {
- tex_curr_pos = (ray_position - left_edge)/range;
+ tex_curr_pos = tle + tdd * (ray_position - left_edge) / range;
vec3 tex_sample = texture(ds_tex, tex_curr_pos).rgb;
//new_color = texture(cmap, tex_sample.r);
new_color = vec4(0.0);
https://bitbucket.org/yt_analysis/yt/commits/331c7ef7049d/
Changeset: 331c7ef7049d
Branch: yt
User: ngoldbaum
Date: 2016-06-02 18:26:09+00:00
Summary: Merged in xarthisius/yt (pull request #2199)
Take into account texture clamping when calculating position in the texture space
Affected #: 4 files
diff -r c117d528f18ea412f8b80e8522a0595444e20ae8 -r 331c7ef7049d257043699a8b570cf7bd8c39a82f .hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -45,9 +45,11 @@
yt/utilities/lib/mesh_intersection.cpp
yt/utilities/lib/mesh_samplers.cpp
yt/utilities/lib/mesh_traversal.cpp
+yt/utilities/lib/mesh_triangulation.c
yt/utilities/lib/mesh_utilities.c
yt/utilities/lib/misc_utilities.c
yt/utilities/lib/particle_mesh_operations.c
+yt/utilities/lib/primitives.c
yt/utilities/lib/origami.c
yt/utilities/lib/particle_mesh_operations.c
yt/utilities/lib/pixelization_routines.c
diff -r c117d528f18ea412f8b80e8522a0595444e20ae8 -r 331c7ef7049d257043699a8b570cf7bd8c39a82f yt/visualization/volume_rendering/shaders/max_intensity.fragmentshader
--- a/yt/visualization/volume_rendering/shaders/max_intensity.fragmentshader
+++ b/yt/visualization/volume_rendering/shaders/max_intensity.fragmentshader
@@ -43,9 +43,14 @@
vec3 tex_curr_pos = vec3(0.0);
vec3 range = right_edge - left_edge;
+ // Take into account that texture is clamped
+ vec3 nds = range / dx;
+ vec3 tle = 1.0 / (2.0 * nds);
+ vec3 tre = 1.0 - tle;
+ vec3 tdd = tre - tle;
bool ray_in_bb = true;
while (ray_in_bb) {
- tex_curr_pos = (ray_position - left_edge)/range;
+ tex_curr_pos = tle + tdd * (ray_position - left_edge) / range;
vec3 tex_sample = texture(ds_tex, tex_curr_pos).rgb;
if (length(curr_color) < length(tex_sample)) {
diff -r c117d528f18ea412f8b80e8522a0595444e20ae8 -r 331c7ef7049d257043699a8b570cf7bd8c39a82f yt/visualization/volume_rendering/shaders/projection.fragmentshader
--- a/yt/visualization/volume_rendering/shaders/projection.fragmentshader
+++ b/yt/visualization/volume_rendering/shaders/projection.fragmentshader
@@ -44,10 +44,15 @@
vec3 tex_curr_pos = vec3(0.0);
vec3 range = right_edge - left_edge;
bool ray_in_bb = true;
+ // Take into account that texture is clamped
+ vec3 nds = range / dx;
+ vec3 tle = 1.0 / (2.0 * nds);
+ vec3 tre = 1.0 - tle;
+ vec3 tdd = tre - tle;
float total_value = 0.0;
float color = 0.0;
while (ray_in_bb) {
- tex_curr_pos = (ray_position - left_edge) / range;
+ tex_curr_pos = tle + tdd * (ray_position - left_edge) / range;
vec3 tex_sample = texture(ds_tex, tex_curr_pos).rgb;
color = (tex_sample * length(step_size * dir)).r;
total_value += length(step_size * dir) * tex_sample.r;
diff -r c117d528f18ea412f8b80e8522a0595444e20ae8 -r 331c7ef7049d257043699a8b570cf7bd8c39a82f yt/visualization/volume_rendering/shaders/transfer_function.fragmentshader
--- a/yt/visualization/volume_rendering/shaders/transfer_function.fragmentshader
+++ b/yt/visualization/volume_rendering/shaders/transfer_function.fragmentshader
@@ -48,8 +48,13 @@
vec3 range = right_edge - left_edge;
vec4 new_color;
bool ray_in_bb = true;
+ // Take into account that texture is clamped
+ vec3 nds = range / dx;
+ vec3 tle = 1.0 / (2.0 * nds);
+ vec3 tre = 1.0 - tle;
+ vec3 tdd = tre - tle;
while (ray_in_bb) {
- tex_curr_pos = (ray_position - left_edge)/range;
+ tex_curr_pos = tle + tdd * (ray_position - left_edge) / range;
vec3 tex_sample = texture(ds_tex, tex_curr_pos).rgb;
//new_color = texture(cmap, tex_sample.r);
new_color = vec4(0.0);
Repository URL: https://bitbucket.org/yt_analysis/yt/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the yt-svn
mailing list