Diffuse Color of Instances based on ID Index

Forums: Diffuse Color of Instances based on ID Index
Newtek Lightwave 3D (exporter developed by holocube, Integrated Plugin developed by juanjgon)

Diffuse Color of Instances based on ID Index

Postby LichtUndSchatten » Wed Jul 17, 2019 9:56 am

LichtUndSchatten Wed Jul 17, 2019 9:56 am
Hello.

Is there a way to apply different RGB Colors to different ID Index ranges of Instances in Octane.
For example i want the diffuse color of ID Index Count from 0-10 to become Red and 11-20 to become blue.
I´ve found the octane random color texture in combination with octane cradient texture but as the name
says: The result is random :)
In Lightwave native i´ve got it done with an Logical node applied to input of an Gradient.
Does someone know a way to do this in Octane Material?

Thanks :)
LichtUndSchatten
Licensed Customer
Licensed Customer
 
Posts: 14
Joined: Fri May 12, 2017 4:12 pm

Re: Diffuse Color of Instances based on ID Index

Postby scooternva » Tue Jul 23, 2019 7:36 pm

scooternva Tue Jul 23, 2019 7:36 pm
Congratulations, I think you've discovered a bug in OctaneRender's Texture Image Node, because this should work.

lightwave_engine_jpg.jpg
Index ID of an instance as the input to a LightWave Gradient node, which in turn feeds the Diffuse channel of a Principled BSDF node


octanerender_engine.jpg
OctaneRender Image Texture Node ignores the procedural output of a Gradient node


I've also attached the LW object and scene demonstrating this (or rather, demonstrating how this does not work).
Attachments
instanced_color_demo.zip
Zip file containing demonstration LightWave object and scene, showing how instanced color works in LightWave but not OctaneRender
(10.18 KiB) Downloaded 10 times
OctaneRender 2018.1.3 | LightWave 2019.0.3 | Win 10 Pro x64 1903 | 2 x Gigabyte AORUS RTX 2080 Ti Xtreme w/NVLink | Gigabyte AORUS Xtreme X399 | AMD Ryzen 2950X | 64 GB RAM | SSDs: Samsung 970 PRO 512 GB + Seagate FireCuda 510 2 TB | https://gammans.zone
User avatar
scooternva
Licensed Customer
Licensed Customer
 
Posts: 32
Joined: Thu Jul 04, 2019 6:13 pm
Location: Suburban Washington DC

Re: Diffuse Color of Instances based on ID Index

Postby juanjgon » Wed Jul 24, 2019 8:11 am

juanjgon Wed Jul 24, 2019 8:11 am
This can't work, sorry. Octane can't evaluate the LightWave instance info node at render time. I hope that Octane will support custom attributes for the hair/instances/particles soon.

Thanks,
-Juanjo
Computer Graphics Software Developer
Octane plugin development and support: LightWave and Houdini
User avatar
juanjgon
Octane Plugin Developer
Octane Plugin Developer
 
Posts: 6972
Joined: Tue Jan 19, 2010 12:01 pm
Location: Spain

Re: Diffuse Color of Instances based on ID Index

Postby baltort » Wed Aug 07, 2019 1:07 pm

baltort Wed Aug 07, 2019 1:07 pm
I've made a bit of progress with this using OSL.

The hit:instance-id attribute always seems to return 0, so isn't much use. The hit:obj-seed attribute is more promising and seems to contain something different for each instance. I'm not sure what the values actually are (they seem to be something close to 100000) but they are sequential. For example this script outputs red or green depending on whether the obj-seed is odd or even. Notice how the resulting pattern is very regular:

----
shader instanceID(
output color c = 0

)
{

int instID;
//getattribute("hit:instance-id", 0, instID); //always seems to return 0
getattribute("hit:obj-seed", 0, instID);

if((instID%2)==0)
c = color(1,0,0);
else
c = color(0,1,0);
}


instance id test 1.jpg
baltort
Licensed Customer
Licensed Customer
 
Posts: 62
Joined: Mon Jul 07, 2014 4:00 pm

Return to Lightwave 3D


Who is online

Users browsing this forum: No registered users and 1 guest

Thu Oct 24, 2019 2:08 am [ UTC ]