新增功能Katana 3.0

3Delight渲染器

Katana现在捆绑3喜悦:单向路径跟踪器,旨在承受生产渲染的高要求。3Delight插件的工作流程选项包括:

  • 完全交互式的实时渲染(添加,减去,修改灯光,对象,材质和相机)
  • 简化的渲染过程管理和采样控制
  • 通过Multilight工具和GafferThree节点进行交互式灯光混合
  • 具有深输出的所有光源类型的快速气氛渲染
  • 跨所有光源类型统一采光
  • 支持Cryptomatte工作流程
  • 完整的OSL阴影引擎

Katana安装程序将3Delight呈现为Katana安装。3Delight可在预览和实时渲染中免费使用。磁盘和批处理渲染需要3delight_r去除水印的许可证;请联系sales@foundry.com了解更多信息。Katana的示例项目现在在需要时使用3Delight渲染器。

注意:  Katana继续通过与渲染器无关的Renderer插件API支持其他渲染器。

九头蛇查看器

Katana 3.0包含一个新的3D场景查看器选项卡,该选项卡比现有的更具交互性和可伸缩性检视器标签。

新查看器由九头蛇,是一种现代的,可扩展的OpenGL渲染体系结构,由Pixar Animation Studios开发,是开源的关键组成部分通用场景描述 (美元)项目。

查看器(九头蛇)标签使用Katana的Viewer API,已从Katana 2.6。

性能改进

性能改进Katana 3.0包括:

  • 改进Katana的场景处理库Geolib3。

    • 大大减少了“无操作”场景图位置的内存和计算开销。

    • 对场景依赖项的无中断烹饪的实验支持。通常,如果从尚未烹饪的位置请求位置数据,或者不在Geolib3的缓存中请求位置数据,则Geolib3会中止并重新安排烹饪操作。启用此功能后,当Geolib3遇到缺少的位置数据时,它将递归地处理该数据,然后在请求位置数据时返回到原始Op。可以通过设置环境变量来启用此功能, KATANA_ENABLE_RECURSIVE_COOKS = 1

    • 优化FnAttribute

      • 现在,通常创建的属性(例如整数[0,256],浮点数0.0f和1.0f,双精度数0.0和1.0,空字符串和空组)仅创建一次,然后可重复使用。这避免了内存分配和处理FnAttribute对象的引用计数的开销。

      • FnAttribute这些类现在可以感知移动,定义了移动构造函数和移动分配运算符。使用受支持的编译器,可以减少处理FnAttribute对象的引用计数的开销。

      • 数据属性现在,类可以获取与其一起构造的数据缓冲区的所有权,而不用创建单独的副本。由于不需要将数据复制到FnAttribute的内部缓冲区中,因此可以帮助减少峰值内存使用量并减少总体渲染时间。
    • 优化了几个对性能至关重要的Geolib3 Op,包括AlembicIn,AttributeSet,ConstraintResolve,LookFileResolve和OpScript。

    • 为避免在API边界上临时复制字符串而进行的优化。例如, GeolibCookInterface现在通过以下方式获取字符串参数字符串视图代替const std :: string&

  • 改进性能渲染日志在处理大量日志输出时, 监控在处理来自渲染器的图像更新时,以及场景图当打开或固定大量位置时。

  • 改进了对节点图名称空间的处理,减少了加载,搜索和操作节点图所需的时间。

  • 改进了节点图和Geolib3 Op树之间的同步时间。

  • 缩短了应用程序启动时间和CPU使用率。

用户界面改进

Katana 3提供了许多功能增强和错误修复,可改善应用程序的整体用户体验。值得注意的变化是:

  • 修改后的调色板使外观更现代,更平整,使艺术家能够专注于自己的作品。

  • 较大的色板。

  • 参数,属性,项目设置和首选项的工具提示,使诸如属性类型之类的信息更易于访问。

  • 重新设计了复选框和单选按钮,以区分这两种控件。

  • 重组标签主菜单和添加标签菜单,可以清楚地区分选项卡的内置类型和从中加载的选项卡类型Katana资源位置以及可以从用户主目录加载的标签的自定义类型。

  • 随应用程序字体大小首选项扩展的更多UI元素。

我们将继续完善用户界面的各个方面Katana即将发布的版本,结合了我们从客户那里收到的反馈。

不推荐使用的功能

  • AttributeScript节点类型已被弃用,并从以下节点的创建菜单中隐藏节点图标签。现有的AttributeScript节点Katana项目仍然有效,并且仍然可以通过以下方式创建AttributeScript节点NodegraphAPI脚本,但是对于新项目,建议使用OpScript节点和Lua。在将来的版本中将删除对AttributeScript节点的支持。

  • 经典的Gaffer节点类型,由GafferThree取代Katana现在,2.0v1已从节点创建菜单中隐藏节点图标签。

  • 以下很少使用的2D节点已从菜单中的菜单中隐藏。 节点图选项卡:ImageAddMix,ImageAtop,ImageAverage,ImageBlack,ImageDifference,ImageDistort,ImageDivide,ImageExclusion,ImageFrom,ImageGeometric,ImageHypot,ImageMatte,ImageMatteMix,ImageMax,ImageMin,ImageMinus,ImageMix,ImageMultiply,ImageOver,ImagePlus,ImageScreen,ImageUnder,ImageWhite。这些节点类型仍然可以通过脚本创建。现有项目中的节点继续像以前一样运行。

  • 颜色/用途SingleComponentRGB偏好,未在商业中使用Katana,已弃用。

第三方软件变更

下表总结了对随附的第三方软件版本的更改Katana

版本中Katana 2.6 版本中Katana 3.0版本9
3喜悦 未出货 13.4.9
阿伦比奇 1.5.3 1.6.1
LuaJIT 未出货 2.1.0
脾气暴躁的 1.5.1(仅Linux) 未出货
蟒蛇 2.7.3 2.7.13
RLM 9.3 12.2
待定 4.4.6 2017更新8
美元 未出货 0.8.0
PyQt 4.10.4 4.11.4
零MQ 3.2.5 4.2.1
PyZeroMQ 13.0.2 16.0.2
VS CRT 2010(仅Windows) 未出货

编译器变更

Katana 3.0在Linux上使用GCC 4.8进行编译,在Windows上使用Visual Studio 2015进行编译。

Katana 2.5和Katana 2.6是使用Linux上的GCC 4.1和Windows上的Visual Studio 2010构建的。

编译器的更改不应影响大多数客户。出于兼容性原因, Katana长期以来,它一直将其API分为一组C ++头文件和直接编译到客户插件库中的源,以及由C ++层包装的稳定的,与编译器无关的基于C的API。例如,编写Geolib Ops的插件作者仍然可以自由选择工具链来构建插件。

本兼容性说明不适用于Windows插件作者构建链接到Python或Qt的插件:客户需要使用Visual Studio 2015重新构建这些插件。

注意:  用于构建Python 2.7 C扩展的标准Windows编译器是Visual Studio 2008,但是该编译器一定不用于构建Python C扩展Katana。客户可能会发现有必要重写distutils / setuptools选择的编译器,以构建与之兼容的本机Python扩展。 Katana。看到https://docs.python.org/2.7/distutils/apiref.html#module-distutils.msvccompiler有关说明。

API变更

Katana 3.0的API继续使用不支持C ++ 11标准的较旧的编译器进行构建。在以后的版本中,将删除对C ++ 98编译器的支持。 Katana

Katana针对的C ++插件Katana 2.5或更高版本二进制兼容Katana 3.0(链接到Python或Qt的Windows插件以及使用开发中的Viewer API的插件除外)。

Katana针对的C ++插件Katana 2.5或更高版本源兼容Katana以下描述了3.0 API,但有一些例外。

示例插件

Katana的示例插件正在逐步迁移到C ++ 11,并且不再保证可以在不支持C ++ 11标准的较旧的编译器中进行构建。

查看器API

Viewer API与Hydra Viewer并行开发,并且与Katana 2.6v4。有关Viewer API的信息,请参见Katana 3.0可以在Katana开发人员指南

资产插件

不建议使用基于Python的AssetAPI插件,并且在将来的版本中将删除对它们的支持。展望未来,出于性能和稳定性的考虑,AssetAPI插件应使用C ++编写。

烹饪界面

GeolibCookInterface :: execOp()现在支持传递私有的用户定义数据(又名“私有数据”)到已执行的操作。这也解决了调用者的私有数据将被被调用者继承的问题。在修改后的行为中,如果调用者execOp()然后不指定任何私人数据getPrivateData() 将返回空值在被叫者中。针对2.5或2.6 SDK构建的Op保留了将私有数据泄漏到由执行的Op中的功能execOp()。但是,我们建议针对3.0 SDK重新构建并使用私人数据的参数execOp()代替。OpScript没有更改,该脚本不支持私有数据。

FnAttribute

实施FnAttribute提高了性能:

  • 静态属性:某些属性(例如整数[0,256],浮点数0.0f和1.0f,双精度数0.0和1.0,空字符串和空组)现在仅创建一次,然后再使用。这意味着它们的引用计数不必增加和减少。
  • 移动构造函数和运算符:这些新运算符(C ++ 11)已在FnAttribute。如果使用新的编译器,它将检测何时可以移动对象,这意味着其引用计数不必增加和减少。

注意:  Katana 3.0v9使用不同的算法来计算属性哈希,因此属性哈希将与Katana 2.x。

的行为数据属性getNearestSample()方法已更改,并且在某些情况下,这将需要更改代码,以便针对该C ++插件进行构建Katana 3.0蜜蜂。

在以前的版本中Katana可以通过调用获取指向样本缓冲区的原始指针getNearestSample(time).data()。由于性能原因,截至Katana 3.0禁止使用该惯用语,并导致编译时错误。FnAttribute现在要求常量向量传回的物件getNearestSample()在调用它之前被分配给一个局部变量数据() 方法。以下是一些示例:

// Works with both Katana 2 and Katana 3. `p` is valid until either of `sample` // or `myIntAttr` are destructed. auto sample = myIntAttr.getNearestSample(.0f); const int* p = sample.data(); // Results in a compile-time error in Katana 3. const int* p = myIntAttr.getNearestSample(.0f).data(); 

为了便于获取指向多采样样本缓冲区的原始指针数据属性对象Katana 3.0引入了新的C ++ API,其形式为getSamples()方法。以下是一些示例:

for (const auto& sample : myIntAttr.getSamples()) { ProcessSample(sample.getSampleTime(), sample.data(), sample.size()); } // Assign the result of `getSamples` to a local variable if you want pointers to // remain valid for longer. Here, the raw pointers stored in `vec` remain valid // until either the `myIntAttr` or `samples` objects are destructed. auto samples = myIntAttr.getSamples(); vector<tuple<float /*time*/, const int* /*data*/, size_t /*size*/>> vec; for (const auto& sample : samples) { vec.emplace_back(sample.getSampleTime(), sample.data(), sample.size()); } 

此外,新getValuesAs()添加了一个函数,该函数返回一个C ++对象,该对象由属性的主要时间样本中的固定数量的值构成。例如,如果您有一个FloatAttribute代表4x4矩阵,您可以使用类似于以下代码将其转换为Imath矩阵对象:

auto m44f = myFloatAttr.getValuesAs<Imath::M44f, 16>(); 

FnAttribute现在可以获取与它们一起构造的数据缓冲区的所有权。由于不需要将数据复制到内存中,因此可以帮助减少峰值内存使用量并减少总体渲染时间。 FnAttribute的内部缓冲区。

FnAttribute要获得数据缓冲区的所有权,调用者必须将删除器函数和非空数据指针(上下文)传递给 FnAttribute的构造函数。这将导致以下结果:

  1. FnAttribute将复制采样时间的值,即{-0.5,0.0,0.5}。
  2. 它将为每个时间样本缓冲区复制指针的值(指针,而不是其指向的指针)。
  3. 销毁后,该属性将调用用户提供的函数,并将用户提供的上下文传递给该函数。请参阅下面的用例示例。
  4. 样本缓冲区和用户提供的上下文(它们可以不同)必须在整个生命周期内保持有效。 FnAttribute已取得数据所有权。

用法示例:

// ----------------------------------------------------------------------------- // Create an IntAttribute with a single time sample of 10 values. int64_t tupleSize = 1; int64_t valueCount = 10; // Create a buffer to store our data -- this must live on the heap, as the // attribute we create stores pointers into this memory block. unique_ptr<int[]> buf(new int[valueCount]); // Fill `buf` with data. // ... FnAttribute::IntAttribute myIntAttr(buf.get(), valueCount, tupleSize, buf.get(), [](void* context) { delete[] static_cast<int*>(context); }); // myIntAttr now owns the buffer. buf.release(); // ----------------------------------------------------------------------------- // Create a FloatAttribute with three time samples of 64 values. int64_t tupleSize = 4; int64_t valueCount = 64; int64_t sampleCount = 3; // Create a buffer to store our data -- this must live on the heap, as the // attribute we create stores pointers into this memory block. unique_ptr<float[]> buf(new float[valueCount * sampleCount]); // Fill `buf` with data. // ... // FnAttribute copies these buffers into internal storage; they need not live on // the heap. const float* samples[] = {&buf[valueCount * 0], &buf[valueCount * 1], &buf[valueCount * 2]}; float sampleTimes[] = {-0.5f, 0.0f, 0.5f}; FnAttribute::FloatAttribute myFloatAttr(sampleTimes, sampleCount, samples, valueCount, tupleSize, buf.get(), [](void* context) { delete[] static_cast<float*>(context); }); // myFloatAttr now owns the buffer. buf.release(); 

现在可以创建StringAttribute拥有用户提供的内存的所有权。结果, StringAttribute现在,常规和零副本哈希的哈希计算也已更改。

以下示例演示了如何创建多样本StringAttribute它获取提供给它的字符串缓冲区的所有权。

const char* kString1 = "We hope"; const char* kString2 = "you enjoy"; const char* kString3 = "Katana 3.0v1."; // Prepare the string data. char** valueArrayForSample1 = new char*[1]; char* dataForSample1 = new char[strlen(kString1) + 1]; memcpy(dataForSample1, kString1, strlen(kString1) + 1); valueArrayForSample1[0] = dataForSample1; char** valueArrayForSample2 = new char*[1]; char* dataForSample2 = new char[strlen(kString2) + 1]; memcpy(dataForSample2, kString2, strlen(kString2) + 1); valueArrayForSample2[0] = dataForSample2; char** valueArrayForSample3 = new char*[1]; char* dataForSample3 = new char[strlen(kString3) + 1]; memcpy(dataForSample3, kString3, strlen(kString3) + 1); valueArrayForSample3[0] = dataForSample3; // Prepare the value pointers and sample time array. char** valuePtrs[3] = {valueArrayForSample1, valueArrayForSample2, valueArrayForSample3}; float sampleTimes[3] = {-0.5f, 0.0f, 0.5f}; // This vector will be passed to StringAttribute's constructor so we can // clean up the data when the attribute is to be destroyed. auto* context = new std::vector<char**>{ valueArrayForSample1, valueArrayForSample2, valueArrayForSample3}; FnAttribute::StringAttribute zeroCopyStringAttribute(sampleTimes, 3, (const char***)valuePtrs, 1, 1, context, [](void* context){ auto* memoryToFree = static_cast<std::vector<char**>*>(context); for(char** dataForSample : *memoryToFree) { delete[] dataForSample[0]; delete[] dataForSample; } delete memoryToFree; }); // Access the attribute data as normal. auto firstSample = zeroCopyStringAttribute.getNearestSample(-0.5f); auto secondSample = zeroCopyStringAttribute.getNearestSample(0.0f); auto thirdSample = zeroCopyStringAttribute.getNearestSample(0.5f); std::cout << "[-0.5] = " << firstSample[0] << std::endl; std::cout << "[0.0] = " << secondSample[0] << std::endl; std::cout << "[0.5] = " << thirdSample[0] << std::endl; 

用法KatanaFnAttribute来自外部应用程序的库(通过 FnAttribute :: Bootstrap()功能)现在始终需要katana_r许可证。

OpScript

对OpScript旧版API的支持已删除。默认情况下,某些API的Alpha版本中提供了此API Katana 2.0v1,但此后默认情况下已禁用。

OpScript节点已升级为使用LuaJIT 2.1.0作为其Lua解释器,这将导致总体性能提高,并为将来的改进奠定基础。所做的更改通常应该是透明的,但是如果您遇到基于LuaJIT的问题,以前基于Lua 5.1的OpScript实现仍然可用。可以通过设置环境变量来选择此实现KATANA_OPSCRIPT_INTERPRETERLua_5_1

LuaJIT更严格地遵循Lua 5.1语言标准,而一些已经继承到Lua 5.1中的Lua 5.0构造在LuaJIT中不可用。这些是:

  • math.mod() function; use math.fmod() or the %运算符。
  • 隐式arg parameter for old-style vararg functions; use Lua 5.1 vararg expressions (...)代替
  • string.gfind() function; use string.gmatch()代替

请注意,我们以“ GC64”模式构建LuaJIT 2.1,以便OpScript不受早期LuaJIT发行版的地址空间限制。

有关更多信息,请参见:

渲染器插件

DiskRenderOutputProcess :: setRenderAction()方法renderAction参数的类型已从更改为std :: auto_ptr <RenderAction>FnPlatform :: internal :: UniquePtr (又名std :: unique_ptr)。如std :: unique_ptr不可复制, FnPlatform :: internal :: UniquePtr :: move (又名std :: unique_ptr :: move)需要显式调用才能将内部指针从一个容器移动到另一个容器。

显示驱动器

现在可以配置发送到Katana通过显示驱动程序API分别为RGBA或ARGB。RGBA是像素使用的内部像素格式Katana并使用此像素格式可确保Katana不必麻烦频道即可重新排序Alpha频道。下面的示例演示如何启用此通道像素格式:

NewChannelMessage_v2Ptr newChannelMessage_v2( new FnKat::NewChannelMessage_v2(*newFrameMessage)); // Setup NewChannelMessage_v2 newChannelMessage_v2->setChannelID(/* Channel ID */); newChannelMessage_v2->setChannelOrigin(0, 0); newChannelMessage_v2->setChannelDimensions(1000, 1000); newChannelMessage_v2->setSampleRate(sampleRate); newChannelMessage_v2->setDataSize(4 * sizeof(float)); newChannelMessage_v2->setPixelLayout(FnKat::NewChannelMessagev2::PixelLayout::RGBA); newChannelMessage_v2->setChannelName(legacyChannelName); 

改善性能Katana的显示驱动程序API,包括减少的内存分配和消息传输开销。

的新“零副本”选项数据信息类型已经介绍。这使显示驱动程序作者可以将像素缓冲区的所有权转移到显示驱动程序API,从而显着减少像素复制和内存分配的开销。例如:

// Pixel buffer clean-up callback. void ImageDataDeleter(void* data) { char* dataArray = reinterpret_cast<char*>(data); delete[] dataArray; } // Sending pixel buffers back to Katana... FnKat::DataMessage dataMsg(/* ... */); // Configure coordinates/dimensions unchanged... // Allocate pixel buffer... char *dataArray = new char[blockSize]; // NEW: Pass pixel data clean-up callback to setData() and the Display Driver  // API will take ownership of the pixel buffer. dataMsg.setData(dataArray, blockSize, ImageDataDeleter); // Send to Katana via Katana Pipe interface pipe->send(dataMsg); 

FnLogging

C ++类FnLogging :: FnLogQueue已被弃用,并将在以后的版本中删除。此类从未起作用过,如果尝试实例化它,则会记录警告。

删除的API

不推荐使用的API标头和源Katana 2.5已被删除。这些标题是:

  • FnGeolib:util / Mutex.h,util / Platform.h,util / PowerNap.h,util / Semaphore.h,util / ThreadException.h,util / Timer.h

  • FnRender:plugin / SocketConnection.h,plugin / CommandLineTools.h

通用插件兼容性

美元

美元二进制对Katana 2.6兼容Katana 3.0。

USD源代码可以针对Katana从USD版本0.8.2。开始为3.0。

支持美元/Katana Windows上的插件仍然不可用。

渲染人

RenderMan用于Katana针对的二进制文件Katana 2.6兼容Katana 3.0。

阿诺德

阿诺德Katana针对的二进制文件Katana 2.6兼容Katana 3.0。