Skip to content

Commit

Permalink
bugfix in gridUVTessellator, artifacts in tutorial08 are gone now
Browse files Browse the repository at this point in the history
  • Loading branch information
cbenthin committed Jan 11, 2015
1 parent e774504 commit 5845452
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions kernels/common/subdiv/tessellation.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,12 @@ namespace embree
{
mic_i u_i ( step );

const mic_m m_u = u_i < grid_u_segments;
const mic_m m_v = v_i < grid_v_segments;

for (unsigned int x=0;x<grid_u_res;x+=16, u_i += 16)
{
const mic_m m_u = u_i < grid_u_segments;

const mic_f u = select(m_u, mic_f(u_i) * inv_grid_u_segments, 1.0f);
const mic_f v = select(m_v, mic_f(v_i) * inv_grid_v_segments, 1.0f);
ustore16f(&u_array[index + x],u);
Expand All @@ -176,11 +177,11 @@ namespace embree
{
avxi u_i ( step );

const avxb m_u = u_i < grid_u_segments;
const avxb m_v = v_i < grid_v_segments;

for (unsigned int x=0;x<grid_u_res;x+=8, u_i += 8)
{
const avxb m_u = u_i < grid_u_segments;
const avxf u = select(m_u, avxf(u_i) * inv_grid_u_segments, 1.0f);
const avxf v = select(m_v, avxf(v_i) * inv_grid_v_segments, 1.0f);
storeu8f(&u_array[index + x],u); // FIXME: store not always 8 bytes aligned !!
Expand Down
2 changes: 1 addition & 1 deletion tutorials/tutorial08/tutorial08_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ Vec3fa renderPixelStandard(float x, float y, const Vec3fa& vx, const Vec3fa& vy,
shadow.time = 0;

/* trace shadow ray */
rtcOccluded(g_scene,shadow);
rtcOccluded(g_scene,shadow);

/* add light contribution */
if (shadow.geomID == RTC_INVALID_GEOMETRY_ID)
Expand Down

0 comments on commit 5845452

Please sign in to comment.