Forum

#1 2018-01-31 13:40:45

Narann
Member

AttributeShader while parsing ribs

Hello dev, I'm working on a parser to parse rib files.

Here is two rib lines:

Code:

Attribute "grouping" "membership" "value"
AttributeShader "DiffuseColor" "Texture" "File" "blahblah.%04d.tex"

Attribute is documented into RenderMan specs:

Code:

RiAttribute(name, parameterlist)

So in your ribs, I guess its:

Code:

Attribute name key value key value key value...

But AttributeShader is not documented, here is my though, please tell me if I'm right:

Code:

AttributeShader attribute_name sub_shader_name key value key value key value...

Where key value are a parameter list for the subshader.

Am I right with this?

Thanks in advance!

Offline

 

#2 2018-01-31 15:01:13

Narann
Member

Re: AttributeShader while parsing ribs

Second questions:

Does AttributeShader take AttributeBegin/AttributeEnd stack in account like Attribute does? Meaning AttributeEnd will pop the AttributeShader of the stack.

Offline

 

#3 2018-01-31 15:23:33

Ben
Guerilla dev, the guy to hug

Re: AttributeShader while parsing ribs

Hi Narann,

AttributeBegin/AttributeEnd pushes/pops the whole attribute stack. Even attributes that could be accessed through other Ri calls, such as Surface, Sided, etc.

AttributeShader is a Guerilla extension.

Code:

AttributeShader user_attr_name shader_name name1 value1 name2 value2 ...

Best!


Benjamin 'Ben' Legros
Guerilla developer
http://www.guerillarender.com

Offline

 

#4 2018-01-31 15:28:23

Ben
Guerilla dev, the guy to hug

Re: AttributeShader while parsing ribs

Note that user attributes are set using:

Code:

Attribute "user" "name" value

While user attribute shaders are set using:

Code:

AttributeShader "name" ...

The "user" token is ommited. By the way, we will probably change this at some point, because so far, all user attributes and shaders are unscoped, which causes trouble when a displacement, surface or volume shader have a parameter with the same name. So, the plan is to properly scope shader attributes.


Benjamin 'Ben' Legros
Guerilla developer
http://www.guerillarender.com

Offline

 

#5 2018-01-31 16:20:56

Narann
Member

Re: AttributeShader while parsing ribs

Thanks Ben, that helps!

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2008 PunBB