Atom Posted October 30, 2015 Share Posted October 30, 2015 (edited) Hi All, I have a crowd system with an attribute that I want to route to a value in the principle shader. I have added a stylesheet text box and I have the following code. { "styles": [ { "target":{"pointGroup" : "@agentgroup=redagents"}, "overrides":{"materialParameters":{"basecolor":[0, @sf_agent_tint, 0]}} }, { "target":{"pointGroup" : "@agentgroup=greenagents"}, "overrides":{"materialParameters":{"basecolor_texture":"$HIP/cc0_Forest_monster/texture/rock_golem_diffuse_green.png"}} }, { "target":{"pointGroup" : "@agentgroup=greenagents"}, "overrides":{"materialParameters":{"basecolor_texture":"$HIP/cc0_Forest_monster/texture/rock_golem_diffuse_green.png"}} } ] } The line with the attribute @sf_agent_tint is failing. How can I relay attribute values directly to shader values? Edited October 30, 2015 by Atom Quote Link to comment Share on other sites More sharing options...
marcin Posted October 31, 2015 Share Posted October 31, 2015 (edited) You can bind attribute and use cvex scirpt to export it. See attached example file. stylesheet.hip Edited October 31, 2015 by marcin Quote Link to comment Share on other sites More sharing options...
Atom Posted October 31, 2015 Author Share Posted October 31, 2015 Thanks for the example, but I don't see how the "tint" variable gets mapped to the diffuse color in the clay shader? What connects those two? The stylesheet maps t:tint then the material overrides clay with tint, but tint does not exist as a parameter on clay...? Also is there a way to just do it in stylesheet code, I don't really want to lay down CVEX nodes? Quote Link to comment Share on other sites More sharing options...
marcin Posted October 31, 2015 Share Posted October 31, 2015 Tint exist as a parameter on clay shader. It's visibile at the bottom of Mantra Surface parameters. Take a look inside diffColor subnet. There is red network box where tint parameter is multiplied by diffuse color. Quote Link to comment Share on other sites More sharing options...
marcin Posted October 31, 2015 Share Posted October 31, 2015 Here is an an example of attribute binding without using cvex script. stylesheet_attribute_binding.hip Quote Link to comment Share on other sites More sharing options...
Atom Posted November 1, 2015 Author Share Posted November 1, 2015 Thanks again for the example file. I am having trouble configuring your example to work with the new PrincipledShader in H15. Using your example I added a principledshader to shopnet1 and set the diffuse color to pure white. I modified the stylesheet code to use basecolorr as the target parameter instead of tint found on clay. { "styles":[ { "label":"Style", "target":{ "label":"Target", "pointGroup":"blueagents" }, "overrides":{ "material":{ "name":"`opfullpath('shopnet1/principledshader')`" }, "materialParameters":{ "basecolorr":{ "script":{ "binding":"agent_tint" } } } } } ] } When I render I get all white agents,however. The intention is to actually replace the value of basecolorr with the attribute value agent_tint. This should produce agents with a varying degree of RED missing from the white base color. Is there some other syntax I need to change to make this work as intended? Quote Link to comment Share on other sites More sharing options...
marcin Posted November 1, 2015 Share Posted November 1, 2015 Take a look at enclosed file. I used a tint parameter to set basecolorr. stylesheet_principledshader.hip Quote Link to comment Share on other sites More sharing options...
Atom Posted November 1, 2015 Author Share Posted November 1, 2015 Ok, I see. You modified the principled material to conform to the stylesheet. One thing I discovered is that I was able to modify basecolor itself. So I am wondering if agent_tint were actually a vector instead of a float I could modify the X channel of the vector to influence the RED value of the base color. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.