mograph shader ISL
- sandidolsak
- Posts: 12
- Joined: Fri Nov 16, 2012 7:15 am
- Location: Slovenia
mograph shader ISL
Hello,
I was trying to use mographs color shader to give some variation to clones, found out soon that is not supported by exporter, I guess this would require a material for each clone...
So I went testing ISL to get variation using 3D noise, my thought process was to simply use objects position for 3D noise and apply the resulting color to whole clone, but how?
I get that pos in
def eval(vec3 pos) vec3: ...
is position of every point, so it applys the noise like expected in 3D, so now I am wondering how to get the objects position to feed it to the noise so I would get 1 color for whole objects...
Thanks for any input!
Cheers
I was trying to use mographs color shader to give some variation to clones, found out soon that is not supported by exporter, I guess this would require a material for each clone...
So I went testing ISL to get variation using 3D noise, my thought process was to simply use objects position for 3D noise and apply the resulting color to whole clone, but how?
I get that pos in
def eval(vec3 pos) vec3: ...
is position of every point, so it applys the noise like expected in 3D, so now I am wondering how to get the objects position to feed it to the noise so I would get 1 color for whole objects...
Thanks for any input!
Cheers
Re: mograph shader ISL
afaik the exporter tries to bake every C4D shader directly, so some ISL input inside that shader wont help here :/
I remember that support for this lovely mograph Shader was requested once, but I forgot what the answer was -.-'
I remember that support for this lovely mograph Shader was requested once, but I forgot what the answer was -.-'
polygonmanufaktur.de
- sandidolsak
- Posts: 12
- Joined: Fri Nov 16, 2012 7:15 am
- Location: Slovenia
Re: mograph shader ISL
Heh, yea I kinda got that far, what I am trying to do now is to do what color shader does with ISL (in my case is just some color variation) so I am trying to do it in code but what I am missing is access to objects position in ISL =)
Re: mograph shader ISL
ISL can access the sample position in world space and object space but not the very object position in world. At the moment it must be an exporter feature to capture whatever scene data into ISL code.
Check out the last functions in the Technical Reference PDF, those ending by vec3 will return a color (or vector) straight out.
But a color can also be composed by individual components, each of the 'real' type in this case:
Perhaps will you figure out the way you can get what you want that way.
Check out the last functions in the Technical Reference PDF, those ending by vec3 will return a color (or vector) straight out.
But a color can also be composed by individual components, each of the 'real' type in this case:
Code: Select all
def eval(vec3 pos) vec3 :
vec3
(
noise(pos * 45.0) * 0.5 +0.5, # R
0.5, # G
pos.z * 0.8 # B
)
obsolete asset
- sandidolsak
- Posts: 12
- Joined: Fri Nov 16, 2012 7:15 am
- Location: Slovenia
Re: mograph shader ISL
That gives variation per sample if I understand the code, what I am after is variation per object, so each object gets different color as a whole (like random shader does it in c4d)
Well it was just a thing I was wondering if it was possible, nothing vital, just testing =)
Thanks for replies!
Cheers
Well it was just a thing I was wondering if it was possible, nothing vital, just testing =)
Thanks for replies!
Cheers
Re: mograph shader ISL
Try objectId()
- sandidolsak
- Posts: 12
- Joined: Fri Nov 16, 2012 7:15 am
- Location: Slovenia
Re: mograph shader ISL
Aha will test that out, btw is there a simple list of stuff I can access via ISL that I could check, I cant find any information in the pdfs or ISL_stdlib.txt about objectid()... I like to exhaust all the options before I pester you guys on forum =)
Thanks alot!
Thanks alot!
Re: mograph shader ISL
could use some explanation in the technical Reference.pdfOnoSendai wrote:Try objectId()
polygonmanufaktur.de
Re: mograph shader ISL
Aha !
I digged this one a little, as expected it's an integer and it might well be material based ? The preview material seem to respond to the ID '3'.
I'm not saavy enough to get a unique RGB from a specific ID though...
I digged this one a little, as expected it's an integer and it might well be material based ? The preview material seem to respond to the ID '3'.
Code: Select all
def eval(vec3 pos) vec3 :
vec3(
if(objectId()==3, 0.7, 0.2)
)
obsolete asset
- sandidolsak
- Posts: 12
- Joined: Fri Nov 16, 2012 7:15 am
- Location: Slovenia
Re: mograph shader ISL
I can't even get past using this id, so it is an integer that I would need to convert to real but it gives an error
says it cannot find real(int) function and it is in technical reference
btw how does one use print(int), it is listed at the end of tech ref...
Sorry for this basic questions, I have alot to learn =)
Cheers
Code: Select all
def eval(vec3 pos) vec3:
vec3(
real(objectId()),
)
btw how does one use print(int), it is listed at the end of tech ref...
Sorry for this basic questions, I have alot to learn =)
Cheers
Re: mograph shader ISL
Hi sandidolsak,sandidolsak wrote:I can't even get past using this id, so it is an integer that I would need to convert to real but it gives an errorsays it cannot find real(int) function and it is in technical referenceCode: Select all
def eval(vec3 pos) vec3: vec3( real(objectId()), )
btw how does one use print(int), it is listed at the end of tech ref...
Sorry for this basic questions, I have alot to learn =)
Cheers
that functions is indeed in the reference but unfortunately it is not implemented currently.
We will fix this soon.
Regards,
Yves
- sandidolsak
- Posts: 12
- Joined: Fri Nov 16, 2012 7:15 am
- Location: Slovenia
Re: mograph shader ISL
Thanks for the info, will let it be then, time to test something else!
Cheers
Cheers
Re: mograph shader ISL
You just wrap it around a value or expression... alas, it does print to the infamous stdout, as such I think it may require API access.sandidolsak wrote:btw how does one use print(int), it is listed at the end of tech ref...
obsolete asset
Re: mograph shader ISL
Just run your scene in indigo_console, then you will see it.CTZn wrote:You just wrap it around a value or expression... alas, it does print to the infamous stdout, as such I think it may require API access.sandidolsak wrote:btw how does one use print(int), it is listed at the end of tech ref...
Re: mograph shader ISL
sandidolsak wrote:I can't even get past using this id, so it is an integer that I would need to convert to real but it gives an errorsays it cannot find real(int) function and it is in technical referenceCode: Select all
def eval(vec3 pos) vec3: vec3( real(objectId()), )
btw how does one use print(int), it is listed at the end of tech ref...
Sorry for this basic questions, I have alot to learn =)
Cheers
real(int x) is checked in for next 3.6 beta release.
Who is online
Users browsing this forum: No registered users and 95 guests