I have a hard time digitizing a specific material, and would appreciate any input you have give me on this. Before I deep dive more in the material, there is some theory I need to make sure works, so here’s my problem:
Imagine you need to apply a material to a plane. The color on the plane need to change according to the camera-angle, but NO the angle in terms of height, but what SIDE you see the plane from. For example: If you see the plane from south, it’s blue, from west it’s read, from north, it’s yellow, and from east it’s purple.
I have tried various setups with fallsoffs that depend on the camera angle, but it’s all connected with the angle to the plane and the cameras direction to the plane. Any ideas?
I have seen the thread you are referring to earlier, but the scenes people are referring to and the plugins mentioned are no longer available. I have written directly to “instinct” in the hope that they can elaborate on the input given, but I have heard nothing and I can achieve the desired result - perhaps because there is some of the input I don’t understand. Any help would be appreciated!
You can’t make that happen on a flat plane, at least not to my knowledge, or that I can figure a method for.
Your material basically acting as you see it is due to the tiny fibres being oriented in a given way, so like crushed velvet, or stripe-mown lawn grass,
a blend of the direction of the grass/fibres and the lighting will create that illusion of colour change.
The nearest I’ve got to anything like that is possibly this attached thing…I’m still recovering from illness so my head aches too much to think any more about it for today COLOUR CHANGE.rar (152 KB)
I’m not sure what fixeighted came up with as I don’t have a newer version of max but I managed to get something workable using a VraySamplerInfoTex and some OSL shaders based on the SimpleGradient sample OSL shader.
It really only works on a flat plane since it’s using the reflection vector from the SamplerInfo texture rather than a true “if it’s viewed from the left it’s this color” kind of calculation. I never really figured out what happens when it’s viewed directly from above (i.e., which color should it be) and what I’ve got really just defaults to the red/yellow pair of composite maps. I can’t imagine having to use this in a scene though, it seems like it would be so unpredictable.
Maybe it’ll help point you in the right direction though. Scene attached. View Direction Test.zip (123 KB)
Hehe, nice one, and that is exactly what the OP asked for, so maybe it’s useful in some way.
This is what I hacked together…not elegant now that I look at it but it appears to work…sort of
Max 21 attached if interested.
Now my day is going to be spent looking at the samplerinfo map, which I’ve not used before… COLOUR CHANGE_max21.rar (139 KB)
@dlparisi I believe we have a winner! At least, it works in theory. Now next step is to replace the vray-colors and apply the correct textures. But from what I can see, it works! Thanks!
Well that was a very interesting experiment. Actually both versions look sort of similar and work well, so please share when you get a result you like using either
The main difference seems to be at the corners; so my interpretation has the colours going from one to the next, whereas this one has intermediate transitions.
Thanks. I didn’t really follow Thorsten’s description from his original post but your screenshot cleared it up for me. With your setup I think you get a better correspondence of left-->green, right-->red, etc. which is a bit easier to understand IMO. It still has a similar problem for surfaces that face directly up or down though (I may have it set up slightly incorrectly though too). Both options still seem like a mess to work with for real materials so I’m interested to see what the final product looks like.
I’ve also updated my material a bit (attached) to fix the straight down view (magenta) by adding in another layer to the final composite map and adding a mask to the red/yellow layer. I’m not sure this is really correct though since it seems like the top view should be 25% of each of the other values. I also fixed the “GREEEN” spelling!
It’s not obvious, but the simplegradient OSL maps use slightly different code at the different nodes. The OSL maps that feed the R/Y composite have code that looks at the “float inValue = Input[0]” value to get the red component of the rgb input from the SamplerInfo map while the OSL maps for the B/G composite uses “float inValue = Input[1]” to get the green component of the rgb input. I swap black and white in the color values to get the ramps to flip. The last composite map has a two more OSL maps as masks whose code have three values (A,B, & F) that also switch the Input between [0] and [1], but the middle color value is black (the two others are white) to mask out the center of each ramp. I wired in a float controller to the “hardness” values as I was experimenting with different settings but I think this should be left at 0.
Lastly, I should add that I am by no means an expert on this as it’s my first time using the SamplerInfoTex material or modifying any OSL code so if something looks off or incorrect please let me know. I cobbled this together and it works but I don’t fully understand it 100%.
I fixed a small error in the setup (I had a ‘-1’ when it should have been a ‘0’ in the yellow OSL mask.) Updated scene attached. View Direction Test_v3.zip (192 KB)