VRay SDK for C#
Loading...
Searching...
No Matches
VRay.UVTextureSampler Class Reference

A class which allows you to sample textures without starting a renderer. It is a simple and lightweight UV sampler which might not work with textures that require information which is obtained during the rendering process. More...

Inherits IDisposable.

Public Member Functions

void Dispose ()
 
bool ReleaseRenderer (out VRayRenderer renderer)
 This method releases the internal renderer(if there is any). Use this method to get the VRayRenderer instance out of the sampler. More...
 
bool Sample (IPluginRef pluginRef, float u, float v, out AColor outResult)
 This method samples the output of the given plugin at point (u, v). The plugin must be related to the VRayRenderer instance which has been used to set up the texture sampler. More...
 
bool Sample (IPluginRef pluginRef, float u, float v, out float outResult)
 This method is an overload of Sample(). It should be used with plugins whose output is a floating point number(float textures). More...
 
bool Sample (IPluginRef pluginRef, float u, float v, out int outResult)
 This method is an overload of Sample(). It should be used with plugins whose output is an integer(int textures). More...
 
VRayImage SampleArea (IPluginRef pluginRef, float fromU, float toU, float fromV, float toV, int width, int height)
 This method samples an area of the output of the given plugin. The area is a rectangle with dimensions: [fromU; toU] x [fromV; toV]. More...
 
IList< float > SampleAreaFloat (IPluginRef pluginRef, float fromU, float toU, float fromV, float toV, int width, int height)
 This method samples an area of the output of the given plugin. The sampled region(it is a rectangle) has dimensions: [fromU; toU] x [fromV; toV]. More...
 
IList< int > SampleAreaInt (IPluginRef pluginRef, float fromU, float toU, float fromV, float toV, int width, int height)
 This method is almost the same as SampleAreaFloat(). The only difference is that it should be used with plugins whose output is an integer(int textures). More...
 
bool SetupRenderer (VRayRenderer renderer)
 This method takes a VRayRenderer instance that will be used for texture sampling. The method does not modify the passed renderer on failure. However, a successful call will make the renderer object unusable until it gets released from the sampler. More...
 

Detailed Description

A class which allows you to sample textures without starting a renderer. It is a simple and lightweight UV sampler which might not work with textures that require information which is obtained during the rendering process.

Member Function Documentation

◆ ReleaseRenderer()

bool VRay.UVTextureSampler.ReleaseRenderer ( out VRayRenderer  renderer)

This method releases the internal renderer(if there is any). Use this method to get the VRayRenderer instance out of the sampler.

Parameters
rendererThe released renderer. It is set to null if currently there is no renderer in the sampler.
Returns
True - on successful release and false - on failure.

◆ Sample() [1/3]

bool VRay.UVTextureSampler.Sample ( IPluginRef  pluginRef,
float  u,
float  v,
out AColor  outResult 
)

This method samples the output of the given plugin at point (u, v). The plugin must be related to the VRayRenderer instance which has been used to set up the texture sampler.

Parameters
pluginRefThe plugin whose output(main or alternative) will be sampled and which returns AColor as a result.
uThe u-coordinate of the sample point.
vThe v-coordinate of the sample point.
outResultThe result of the sampling.
Returns
The returned value indicates whether the sampling has been successful or not. True - on success and false - on failure

◆ Sample() [2/3]

bool VRay.UVTextureSampler.Sample ( IPluginRef  pluginRef,
float  u,
float  v,
out float  outResult 
)

This method is an overload of Sample(). It should be used with plugins whose output is a floating point number(float textures).

Parameters
pluginRefThe plugin whose output(main or alternative) will be sampled and which returns float as a result.
uThe u-coordinate of the sample point.
vThe v-coordinate of the sample point.
outResultThe result of the sampling.
Returns
The returned value indicates whether the sampling has been successful or not. True - on success and false - on failure

◆ Sample() [3/3]

bool VRay.UVTextureSampler.Sample ( IPluginRef  pluginRef,
float  u,
float  v,
out int  outResult 
)

This method is an overload of Sample(). It should be used with plugins whose output is an integer(int textures).

Parameters
pluginRefThe plugin whose output(main or alternative) will be sampled and which returns int as a result.
uThe u-coordinate of the sample point.
vThe v-coordinate of the sample point.
outResultThe result of the sampling.
Returns
The returned value indicates whether the sampling has been successful or not. True - on success and false - on failure

◆ SampleArea()

VRayImage VRay.UVTextureSampler.SampleArea ( IPluginRef  pluginRef,
float  fromU,
float  toU,
float  fromV,
float  toV,
int  width,
int  height 
)

This method samples an area of the output of the given plugin. The area is a rectangle with dimensions: [fromU; toU] x [fromV; toV].

Parameters
pluginRefThe plugin whose output(main or alternative) will be sampled and which returns AColor as a result.
fromUThe u-coordinate from which to sample.
toUThe u-coordinate to which to sample.
fromVThe v-coordinate from which to sample.
toVThe v-coordinate to which to sample.
widthThe width of the resulting VRayImage.
heightThe height of the resulting VRayImage.
Returns
A VRayImage with the result of the sampling. The image has dimensions: (width; height) on success or is null on failure.

◆ SampleAreaFloat()

IList< float > VRay.UVTextureSampler.SampleAreaFloat ( IPluginRef  pluginRef,
float  fromU,
float  toU,
float  fromV,
float  toV,
int  width,
int  height 
)

This method samples an area of the output of the given plugin. The sampled region(it is a rectangle) has dimensions: [fromU; toU] x [fromV; toV].

Parameters
pluginRefThe plugin whose output(main or alternative) will be sampled and which returns float as a result(float textures).
fromUThe u-coordinate from which to sample.
toUThe u-coordinate to which to sample.
fromVThe v-coordinate from which to sample.
toVThe v-coordinate to which to sample.
widthThe width of the sample area, which determines the sample step(resolution) of the u-coordinate.
heightThe height of the sample area, which determines the sample step(resolution) of the v-coordinate.
Returns
IList with the result, which can be treated as a 2D array with dimensions: (height rows, width cols) on success or null - on failure.

◆ SampleAreaInt()

IList< int > VRay.UVTextureSampler.SampleAreaInt ( IPluginRef  pluginRef,
float  fromU,
float  toU,
float  fromV,
float  toV,
int  width,
int  height 
)

This method is almost the same as SampleAreaFloat(). The only difference is that it should be used with plugins whose output is an integer(int textures).

Parameters
pluginRefThe plugin whose output(main or alternative) will be sampled and which returns int as a result(int textures).
fromUThe u-coordinate from which to sample.
toUThe u-coordinate to which to sample.
fromVThe v-coordinate from which to sample.
toVThe v-coordinate to which to sample.
widthThe width of the sample area, which determines the sample step(resolution) of the u-coordinate.
heightThe height of the sample area, which determines the sample step(resolution) of the v-coordinate.
Returns
IList with the result, which can be treated as a 2D array with dimensions: (height rows, width cols) on success or null - on failure.

◆ SetupRenderer()

bool VRay.UVTextureSampler.SetupRenderer ( VRayRenderer  renderer)

This method takes a VRayRenderer instance that will be used for texture sampling. The method does not modify the passed renderer on failure. However, a successful call will make the renderer object unusable until it gets released from the sampler.

Parameters
rendererThe renderer which will be used for sampling.
Returns
True if the setup has been successful and false - otherwise.

The documentation for this class was generated from the following file: