Skip to content

classHTexInfo 02

Member Function Documentation

HAttrProperty * HTexInfo::GetAttr  ) 
 

Retrieves a pointer to the surface properties. Retrieves a pointer to the surface properties such as diffuse, specular, ambiance colors, roughness, transparency, reflectivity, etc.

Note:
The retrieved pointer is to the properties as set by the user in the PWS. This is not the same as the actual object surface colors (diffuse, specular, ambiance, etc.) that are found in the HShading class.

Vector HTexInfo::GetD  ) 
  Normalized incoming direction of light ray. In screen space. Must be negated to get a vector pointing away from surface.

Vector HTexInfo::GetEye  ) 
  Point view ray was cast from. In screen space. Since this point is in screen space, a value of (0, 0, 0) means that the view ray was cast from the camera which is the normal situation. Any other values means that the view ray was casted from somewhere else. This is the case when the view ray is deflected by a relfective surface. In this case, the returned vector is the position, in screen space, on the surface where the view ray was reflected.

float HTexInfo::GetFPS  ) 
 

Vector HTexInfo::GetGlobalP  ) 
 

3D hit coordinate. In world space.

Note:

The returned value is only valid if the user have turned GlobalAxis ON in the material properties.

From a Shader plugin, use HShader::GetHitP instead of this.

float HTexInfo::GetHeight  ) 
  Gets displacement of surface. The Height value is currently only used by textures themselves. It is a way to pass the height from one texture to another. For instance, you might have a texture that creates canyons, tweaking the normal to give this look, and setting the Height value as it goes. There could be another texture that sets the diffuse color according to the Height value.

Matrix34 * HTexInfo::GetMatrix  ) 
 

matrix to get from model space to screen space. In some textures it is necessary to convert a vector from texture space to screen space. This matrix is provided for this reason. To convert the normal to screen space and back again you could do the following:

TransformVectorNoTranslate( texinfo.matrix, delta );

Vector * HTexInfo::GetN  ) 
  surface normal at hit point. In screen space. This is the surface normal at hit point (where the ray hits the surface). This normal can be tweaked by your plugin to cause a bumped surface. This Vector is normalized before being passed to Evaluate, and it should be normalized by your plugin before returning. You can use the Vector::Normalize function to accomplish this.

HObject * HTexInfo::GetObject  ) 
  Retrieves a pointer to the object being shaded. The pointer must be casted to the appropriate object which can be determined with GetObjectType(). For instance, when the object type is FIGUREOBJ, then the pointer should be cast to (HModel *).

int HTexInfo::GetObjectType  ) 
 

Retrieves the Object Type of the object being shaded. The object type can be any value from those enumerated in RType.h. If the object type is FIGUREOBJ, then GetObject() can be used to get to the HModel which is being shaded.

Note:
This will not return the same object type as HHashObject.

float HTexInfo::GetPixelWidth  ) 
  Screen pixel size at hit in AM units (cm). The Pixel width may be used by a texture plugin to compute proper antialiasing texture values.

void * HTexInfo::GetSubObject  ) 
 

Retrieves a pointer to the sub object being shaded.

Note:
When the raytracer hits a model, GetObject() hit retrieve a pointer to an object that derives off of RObject (Renderable Object). If the Object is a FIGUREOBJ, thus a HModel, then the sub object would be the HPatch that it hit. If the Object is a RPROP the sub object would be a IEPoly.

float HTexInfo::GetTime  ) 
 

time (in seconds) to evaluate. This is the elapsed time in the current choreography that the texture resides in. It is stored in seconds. This variable is there just because we thought somebody might want to know.

Note:
(for SDK v8) Note that all values within your ChannelInfo array are already interpolated to reflect their current values.

float HTexInfo::SetHeight float  val  )