本文整理汇总了C++中osl::TextureSystem::environment方法的典型用法代码示例。如果您正苦于以下问题:C++ TextureSystem::environment方法的具体用法?C++ TextureSystem::environment怎么用?C++ TextureSystem::environment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类osl::TextureSystem
的用法示例。
在下文中一共展示了TextureSystem::environment方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: environment
bool OSLRenderServices::environment(ustring filename,
TextureHandle *texture_handle,
TexturePerthread *thread_info,
TextureOpt &options,
OSL::ShaderGlobals *sg,
const OSL::Vec3 &R,
const OSL::Vec3 &dRdx,
const OSL::Vec3 &dRdy,
int nchannels,
float *result,
float *dresultds,
float *dresultdt,
ustring *errormessage)
{
OSLTextureHandle *handle = (OSLTextureHandle *)texture_handle;
OSL::TextureSystem *ts = texture_system;
bool status = false;
if (handle && handle->oiio_handle) {
if (thread_info == NULL) {
ShaderData *sd = (ShaderData *)(sg->renderstate);
KernelGlobals *kernel_globals = sd->osl_globals;
OSLThreadData *tdata = kernel_globals->osl_tdata;
thread_info = tdata->oiio_thread_info;
}
status = ts->environment(handle->oiio_handle,
thread_info,
options,
R,
dRdx,
dRdy,
nchannels,
result,
dresultds,
dresultdt);
}
else {
status = ts->environment(
filename, options, R, dRdx, dRdy, nchannels, result, dresultds, dresultdt);
}
if (!status) {
if (nchannels == 3 || nchannels == 4) {
result[0] = 1.0f;
result[1] = 0.0f;
result[2] = 1.0f;
if (nchannels == 4)
result[3] = 1.0f;
}
}
else if (handle && handle->processor) {
ColorSpaceManager::to_scene_linear(handle->processor, result, nchannels);
}
return status;
}
示例2: environment
bool OSLRenderServices::environment(ustring filename, TextureOpt &options,
OSL::ShaderGlobals *sg, const OSL::Vec3 &R,
const OSL::Vec3 &dRdx, const OSL::Vec3 &dRdy, float *result)
{
OSL::TextureSystem *ts = osl_ts;
ShaderData *sd = (ShaderData *)(sg->renderstate);
KernelGlobals *kg = sd->osl_globals;
OSLThreadData *tdata = kg->osl_tdata;
OIIO::TextureSystem::Perthread *thread_info = tdata->oiio_thread_info;
OIIO::TextureSystem::TextureHandle *th = ts->get_texture_handle(filename, thread_info);
bool status = ts->environment(th, thread_info,
options, R, dRdx, dRdy, result);
if(!status) {
if(options.nchannels == 3 || options.nchannels == 4) {
result[0] = 1.0f;
result[1] = 0.0f;
result[2] = 1.0f;
if(options.nchannels == 4)
result[3] = 1.0f;
}
}
return status;
}
示例3: environment
bool OSLRenderServices::environment(ustring filename, TextureOpt &options,
OSL::ShaderGlobals *sg, const OSL::Vec3 &R,
const OSL::Vec3 &dRdx, const OSL::Vec3 &dRdy, float *result)
{
OSL::TextureSystem *ts = kernel_globals->osl->ts;
bool status = ts->environment(filename, options, R, dRdx, dRdy, result);
if(!status) {
if(options.nchannels == 3 || options.nchannels == 4) {
result[0] = 1.0f;
result[1] = 0.0f;
result[2] = 1.0f;
if(options.nchannels == 4)
result[3] = 1.0f;
}
}
return status;
}