Isotropix Forums

How to use textured attribute values?

Discuss about expressions in Clarisse

How to use textured attribute values?

Unread postby atnreg » Sun Aug 18, 2019 1:04 pm

Hi!

Is it possible to use expressions to read textured values?

create light, make some instances
-custom attr 'exp_master'
-custom attr 'exp_adjust'
-expression exposure=get_double("exp_master")+get_double("exp_adjust")
-localize: exposure, exp_adjust

This works so that using exp_master I can adjust all light instances' exposures and then individually adjust the instance lights with exp_adjust.
BUT even if the exp_adjust is texturable, the texture (even constant_color) has no effect on expression, the direct value still does the adjusting so I was wondering if there is limit in expressions and textured values? Or is there some trick to get the textured value instead of direct value? :)

Thank you!
Antti
AMD Ryzen Threadripper 2990wx (32c/64t),64GB RAM,NVIDIA RTX 3090,Win10
UE5,Clarisse 5.0(always latest SP),Houdini,Blender,ZBrush,Onyx...
Started: Clarisse 2016/10 (Py 2017/01), Python 2016/11
No business, just fun :)
atnreg
 
Posts: 599
Joined: Mon Sep 19, 2016 4:20 pm
Location: Helsinki, Finland

Re: How to use textured attribute values?

Unread postby dboude » Mon Aug 26, 2019 11:06 am

Hi,

I guess you cannot texture a double attribute. But I'm not 100% sure. dcourtois will be back soon (holiday) and will confirm (or not) that.

Cheers ;)
Démian
Isotropix
Technical Artist - Clarisse Specialist
User avatar
dboude
 
Posts: 1603
Joined: Mon Jul 03, 2017 10:51 am

Re: How to use textured attribute values?

Unread postby atnreg » Mon Aug 26, 2019 1:14 pm

Hi!

Ok, thanks, I just noticed that it does not work with color attribute either so the double may not be the problem.
To clarify things, here is example project which shows the problem :)

Please see the attached project:
box1: uses box1_mat material
box2: uses box2_mat material
box1_mat: base_color value is red (1,0,0) but texture comes from constant_color that has blue (0,0,1) color
box2_mat: base_color uses expressions get_vec3("box1_mat.base_color")[0], get_vec3("box1_mat.base_color")[1] etc.
constant_color: used as textured color for box1_mat
checker: not used but if used as texture for box1_mat, same result

Box2 should be blue but it is red.

How to get it correct or does the expressions really ignore textured values (which would be very sad but may be unavoidable because of how expressions work)? :shock:

Thank you :)
Attachments
textured_color_expression_problem.project
(55.17 KiB) Downloaded 735 times
Antti
AMD Ryzen Threadripper 2990wx (32c/64t),64GB RAM,NVIDIA RTX 3090,Win10
UE5,Clarisse 5.0(always latest SP),Houdini,Blender,ZBrush,Onyx...
Started: Clarisse 2016/10 (Py 2017/01), Python 2016/11
No business, just fun :)
atnreg
 
Posts: 599
Joined: Mon Sep 19, 2016 4:20 pm
Location: Helsinki, Finland

Re: How to use textured attribute values?

Unread postby dcourtois » Thu Sep 19, 2019 9:25 am

Hi,

You can't evaluate textures using expressions. Texture evaluation is done during rendering, when the materials are sampled.
Expressions are only at the attribute level. They can only be used to control the attribute values, *not* the way those values are used.

I don't really understand why you'd want to use expressions to do what you described in your first post though ? It should be pretty simple to do that using a few material nodes, no ?
User avatar
dcourtois
 
Posts: 130
Joined: Tue Jul 25, 2017 3:15 pm

Re: How to use textured attribute values?

Unread postby atnreg » Thu Sep 19, 2019 3:42 pm

dcourtois wrote:Hi,

You can't evaluate textures using expressions. Texture evaluation is done during rendering, when the materials are sampled.
Expressions are only at the attribute level. They can only be used to control the attribute values, *not* the way those values are used.

I don't really understand why you'd want to use expressions to do what you described in your first post though ? It should be pretty simple to do that using a few material nodes, no ?


Oh that was long time ago...hmm...what was it all about...oh yes, I would have wanted to use it to make adjustable instances of lights with one master and then each instance had adjustment to make variation (mimic the light scattering variations).

But now I know it is not possible which is not what I was hoping for but can't help it :mrgreen:

Thank you!
Antti
AMD Ryzen Threadripper 2990wx (32c/64t),64GB RAM,NVIDIA RTX 3090,Win10
UE5,Clarisse 5.0(always latest SP),Houdini,Blender,ZBrush,Onyx...
Started: Clarisse 2016/10 (Py 2017/01), Python 2016/11
No business, just fun :)
atnreg
 
Posts: 599
Joined: Mon Sep 19, 2016 4:20 pm
Location: Helsinki, Finland


Return to Expressions