| Avoid Yellowish color in AIS_TexturedShape |
 |
| Massimo Del Fedele |
2012/12/01 18:35 |
As seen in some previous posts, AIS_TexturedShape has a bug that prevents using different material than
default one (Bronze), giving to all textured shapes a yellowish color.
After many trial and error, I found a simple patch for AIS_TexturedShape.cxx that solves the problem; from line 369
if (DoRepeat)
mytexture->EnableRepeat();
else
mytexture->DisableRepeat();
const gp_Pnt2d aUVOrigin (myUOrigin, myVOrigin);
const gp_Pnt2d aUVRepeat (myURepeat, myVRepeat);
const gp_Pnt2d aUVScale (myScaleU, myScaleV);
just insert a couple of lines, resulting in :
if (DoRepeat)
mytexture->EnableRepeat();
else
mytexture->DisableRepeat();
myAspect->SetFrontMaterial(Material());
myAspect->SetBackMaterial(Material());
const gp_Pnt2d aUVOrigin (myUOrigin, myVOrigin);
const gp_Pnt2d aUVRepeat (myURepeat, myVRepeat);
const gp_Pnt2d aUVScale (myScaleU, myScaleV);
This will allow TexturedShape to fetch its material during shading; choosing a more 'neutral'
material (like silver-steel-plastic) will then give a quite realistic result.
I'd suggest it as a patch for TexturedShape.cxx
Ciao
Max
|
 |
| | | |