MATERIAL override in LOP/SOLARIS, reading primvar
1890 7 2- alteredgene
- Member
- 19 posts
- Joined: 3月 2020
- Offline
Hi everyone! been testing out USD on a project.
in SOPs, I was able to have a
1. texture file name on as an attribute on PRIM.
2. and via using material override, I was able to "change" the texture file on the material.
I was trying to replicate this on SOLARIS, but was having a hard time.
In fact did some research on the forum, sounds like it might not be possible. I am running REDSHIFT.
After searching online forums, I tried the above, but not working. not sure if I have done it wrong, or if it is REDSHIFT issue?
thank you in advance for all your help!
in SOPs, I was able to have a
1. texture file name on as an attribute on PRIM.
2. and via using material override, I was able to "change" the texture file on the material.
I was trying to replicate this on SOLARIS, but was having a hard time.
In fact did some research on the forum, sounds like it might not be possible. I am running REDSHIFT.
After searching online forums, I tried the above, but not working. not sure if I have done it wrong, or if it is REDSHIFT issue?
thank you in advance for all your help!
- mtucker
- スタッフ
- 4525 posts
- Joined: 7月 2005
- Offline
I don't know if redshift is capable of this, but I would expect it is... The key thing is that your material needs to have a "primvar reader" node to let it know it should be looking for the textureReader primvar on the geometry to determine which texture to load. Attached is an example that shows a couple of different ways of setting such primvars. In both cases the material is a simple USD preview surface with a UV Texture node driving the diffuse color, and a primvar reader node driving the file input of the UV Texture node.
- alteredgene
- Member
- 19 posts
- Joined: 3月 2020
- Offline
Thank you for your response and the sample file! i had a look and learned few new things!
I apologize if my wording was bit confusing due to terms, still learning the USD terms.
I have also attached a sample HIP file.
so basically I have a situation where each SOP primitives (as in each mesh faces) need to have different texture applied to them.
so each SOP primitive will have s@mytexture = "random_texture.jpg". However, this is a single MESH.
with HOUDINI, I could use the and use material override to get material to read different texture file for different faces.
However, I was having difficulty achieving this with SOLARIS.
Further assistance would be greatly appreciated!!
I apologize if my wording was bit confusing due to terms, still learning the USD terms.
I have also attached a sample HIP file.
so basically I have a situation where each SOP primitives (as in each mesh faces) need to have different texture applied to them.
so each SOP primitive will have s@mytexture = "random_texture.jpg". However, this is a single MESH.
with HOUDINI, I could use the and use material override to get material to read different texture file for different faces.
However, I was having difficulty achieving this with SOLARIS.
Further assistance would be greatly appreciated!!
Edited by alteredgene - 2024年4月3日 00:41:55
- mtucker
- スタッフ
- 4525 posts
- Joined: 7月 2005
- Offline
- Heileif
- Member
- 183 posts
- Joined: 1月 2015
- Offline
Just a little heads-up regarding Redshift.
To use primvar strings with Redshift, you need to feed the string into this OSL shader [github.com] using the "RS String User Data" node.
To use primvar strings with Redshift, you need to feed the string into this OSL shader [github.com] using the "RS String User Data" node.
Edited by Heileif - 2024年4月3日 19:18:38
- alteredgene
- Member
- 19 posts
- Joined: 3月 2020
- Offline
Thank you for all your responses.
@mtucker, yes you are right, it works in karma. my apologies. since your example worked on the viewport, when I did not see my viewport showing the result, I just assumed I did something wrong.
However, I am trying to get the setup running in REDSHIFT, and still having problem.
@Heilieif, thank you for the comment. I have downloaded the OSL, and have it setup. the setup seems to be working (I can at least see the default texture showing up from "RS string user date". however, its not reading the .png files I have setup as an attribute.
NOTE I had to replace .rat files to .png files to get them rendering in REDSHIFT.
also attached the HIP file with redshift setting.
@mtucker, yes you are right, it works in karma. my apologies. since your example worked on the viewport, when I did not see my viewport showing the result, I just assumed I did something wrong.
However, I am trying to get the setup running in REDSHIFT, and still having problem.
@Heilieif, thank you for the comment. I have downloaded the OSL, and have it setup. the setup seems to be working (I can at least see the default texture showing up from "RS string user date". however, its not reading the .png files I have setup as an attribute.
NOTE I had to replace .rat files to .png files to get them rendering in REDSHIFT.
also attached the HIP file with redshift setting.
- viscu
- Member
- 3 posts
- Joined: 7月 2023
- Offline
- cdordelly
- Member
- 162 posts
- Joined: 11月 2016
- Offline
-
- Quick Links