Commit f007e8aa authored by hrchilds's avatar hrchilds

Merge RC to trunk, picking up ray casting fixes.


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@13920 18c085ea-50e0-402c-830e-de6fd14e8384
parent b412befe
......@@ -115,12 +115,16 @@ avtPhong::~avtPhong()
// Jeremy Meredith, Mon Jan 4 17:12:16 EST 2010
// Added ability to reduce amount of lighting for low-gradient-mag areas.
//
// Paul Navratil, Tue Feb 8 09:28:28 PST 2011
// Add support for colored lights.
//
// ****************************************************************************
void
avtPhong::AddLighting(int index, const avtRay *ray, unsigned char *rgb) const
{
double r = 0., g = 0., b = 0.;
double lc[4];
const int maxNumLights = 8;
for (int i = 0 ; i < maxNumLights ; i++)
......@@ -130,11 +134,12 @@ avtPhong::AddLighting(int index, const avtRay *ray, unsigned char *rgb) const
continue;
double brightness = l.GetBrightness();
l.GetColor().GetRgba(lc);
if (l.GetType() == LightAttributes::Ambient)
{
r += brightness*rgb[0];
g += brightness*rgb[1];
b += brightness*rgb[2];
r += brightness*rgb[0]*lc[0];
g += brightness*rgb[1]*lc[1];
b += brightness*rgb[2]*lc[2];
}
else
{
......@@ -185,9 +190,9 @@ avtPhong::AddLighting(int index, const avtRay *ray, unsigned char *rgb) const
grad[2]*grad[2]);
if (mag == 0.)
{
r += brightness*rgb[0];
g += brightness*rgb[1];
b += brightness*rgb[2];
r += brightness*rgb[0]*lc[0];
g += brightness*rgb[1]*lc[1];
b += brightness*rgb[2]*lc[2];
continue;
}
grad[0] /= mag;
......@@ -210,9 +215,9 @@ avtPhong::AddLighting(int index, const avtRay *ray, unsigned char *rgb) const
}
diffuse = 1.0 - (diffuseScale * (1.0-diffuse));
r += brightness*diffuse*rgb[0];
g += brightness*diffuse*rgb[1];
b += brightness*diffuse*rgb[2];
r += brightness*diffuse*rgb[0]*lc[0];
g += brightness*diffuse*rgb[1]*lc[1];
b += brightness*diffuse*rgb[2]*lc[2];
if (doSpecular)
{
......
......@@ -21,8 +21,10 @@ list of changes in release 2.2.1.</p>
<li>VisIt's simV2 simulation instrumentation library was fixed so operations that require synchronization with the viewer, such as <i>VisItUpdatePlots()</i>, do not lock up in parallel when a simulation's slave callback function does not broadcast integers.</li>
<li>The xmlinfo tool now generates the correct plugin info for operator plugins that create expressions from vectors or tensors.</li>
<li>The xmledit tool now correctly greys out the operator section for plot and database plugins.</li>
<li>File format readers that produce point meshes with degenerate connectivity are now better supported: Pseudocolor plots now get the correct range for these files.</li>
<li>File format readers that produce point meshes with degenerate connectivity are now better supported; Pseudocolor plots now get the correct range for these files.</li>
<li>Fixed problem with using Pick after animating through time.</li>
<li>The ray-casted volume renderer now properly honors non-white light sources.</li>
<li>When doing a ray-casted volume rendering, changes to the <i>Smoothing</i> button now correctly take effect in the lighting model.</li>
</ul>
<p><b><font size="4">Enhancements in version 2.2.1</font></b></p>
......
......@@ -821,6 +821,10 @@ CreateViewInfoFromViewAttributes(avtViewInfo &vi, const View3DAttributes &view)
// Hank Childs, Thu May 20 21:32:04 PDT 2010
// Use a more efficient version of Log10-with-minimum.
//
// Paul Navratil, Tue Feb 8 09:32:03 PST 2011
// If we want to create an expression with name 'X' and 'X' is already
// an expression in the list, then delete 'X' before adding the new one.
//
// ****************************************************************************
avtContract_p
......@@ -905,15 +909,33 @@ avtVolumeFilter::ModifyContract(avtContract_p contract)
SNPRINTF(exprName, 128, "_%s_gradient", gradvar);
char exprDef[512];
ExpressionList *elist = ParsingExprList::Instance()->GetList();
if (atts.GetSmoothData())
{
SNPRINTF(exprDef, 512, "gradient(recenter(<%s>, \"nodal\"), \"fast\")", gradvar);
for (int i=0; i < elist->GetNumExpressions(); ++i)
{
if ((*elist)[i].GetName() == exprName)
{
debug3 << "Removed expression '" << exprName << "' from expression list to recalculate gradient" << endl;
elist->RemoveExpressions(i);
break;
}
}
}
else
{
SNPRINTF(exprDef, 512, "gradient(<%s>, \"fast\")", gradvar);
for (int i=0; i < elist->GetNumExpressions(); ++i)
{
if ((*elist)[i].GetName() == exprName)
{
debug3 << "Removed expression '" << exprName << "' from expression list to recalculate gradient" << endl;
elist->RemoveExpressions(i);
break;
}
}
}
ExpressionList *elist = ParsingExprList::Instance()->GetList();
Expression *e = new Expression();
e->SetName(exprName);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment