Interior mapping shader

Cannot wait to try it Rens!:slight_smile: Thank you!

Yep really looking forward for this too!

Stan

Ok here we go!

Some things to do still but the base shader is working nicely!

Open the ZIP file and load the OSL in a VRayOSLTex, then just connect the atlas map and adjust the scaling.

Have fun! :slight_smile:



Interior_Mapping_001.zip (297 KB)

Hi Kakashi, the I (or localI) needed to be inverted, then it works.

Rens, I’m testing but i can’t make it working.
I did as you wrote.
I have vray 3.20.02 on max2012.
Loaded the OSL shader inside the VrayOSLMtl and left the coordinates as you shown.
In the material editor the sample sphere is blank and the render is black. The strange thing is also that the alpha channel is full black.

I’ve checked if it’s a lighting problem but using a VrayMtl all is OK.

Where am I wrong?

Hi Bardo, make sure you place a bitmap with the atlas map in the atlas_bitmap slot in the OSL shader (above RoomCount).

Ah I see you wrote VrayOSLMtl, it should be VRayOSLTex. : )

Hey Rens, this is great! Can I add the shader to the repo of OSL shaders here? OSL Shaders

Best regards,
Vlado

Sure, that’d be great! I’ll add some things to the shader but I’ll just post it here. : )

just out of curiosity how do the settings work exactly ?
I would expect that if I have a box and I set the roomcount to 1,1,1 I get to see 1 room stretched to whatever size my box is ?
I guess that’s not how an osl shader works ?

It could probably, at least it’s possible with OSL, but this setup ignores any UV coordinates and instead works with XYZ object/local space coordinates. Like a 3D procedural noise map would.

So basically the room size in units would be the same for a large or a small box (if it’s not scaled), the large one would just have more rooms.

Sweet! Nice work Rens!

Hey Patrick! Yeah this would’ve been nice on Star Trek. : )

ah ok, I see, but in that case, it would be superusefull to have a roomsize setting or something per axis.
right now, it’s either rather hard or undoable (it could be me) to get the amount of rooms you would want/expect
the default size of the room appears to be 1.50mx1.50mx1.50m while the atlas takes a different size (a roomcount of 1x1x3 looks like it’s near the ok point of how the room looks.

for a shader like this, I guess a UV related approach would work better ?

other then that, really way cool that you’re picking this up, this will be a real timesaver for rendering archviz exteriours with visible interiors :smile:

Good points, I’ll see if something like that could be built in. Glad it helps! :smile:

I’m used to create a plane (or dup the back side of glass) and map that with a UV Map to face, and have a multi sub object with different interior maps.
I can really easily have a bunch of different variety on the bld.

Haven’t tried yet, but the whole point of this OSL shader is to blend between maps depending on the viewing angle isn’t it?

Stan

Hey Stan,

No, the point is to simulate depth (rooms) where there is none. So moving around a cube it would appear as though there are rooms in there, moving with correct parallax and perspective, even though there are only six polys. Though it does switch maps depending on which side you look at it as well. :slight_smile:

I hope to have some time soon to update the shader.

Hey Rens,

I understand the concept of what it should look like visually, I was wondering if the technical part was about blending between different maps depending on the angle of view to simulate what we have inside.

For exemple, this is one of our many interior we build to simulate viewing angle :

we cropped this image into 6 different materials piped into a multisub mtl.
We then adjust the planes behind the glass for each lvl of the bld the mtl ID to get the best angle of view for the interiors.
let say you have your cam on the ground floor, then the first 3 lvl of the bld will have ID 3, from lvl 4-6, id 2 and lvl 7-10 id 1

It’s something I build 4 years ago and we use it in nearly all our jobs since as this work incredibly well.
The down part is that we still need to manually assign the ID on the planes behind the glass.
I was wondering if your script could take care of that manual ID assignment.
Does this make sense?

Cheers
Stan

Please excuse my reopening an older thread. But I’m curious if this OSL tex will work in Maya and what kind of changes I may need to make to the OSL?

The most obvious, I guess is that Max uses Z+ instead of Y+ for up.

I am attempting to pipe the OSL file through a VRayTexOSL node, into a VRayLightMtl node. I am getting black renders of the geometry (I have attempted a cube and a plane).

============================================================================================================

I made a minor change to the OSL to adjust the Z to Y issue. It appears to work.

When set the Color Output to Col_Out I actually see the textures as expected, however, it looks like some rooms walls may be random (is this in the OSL, I’m not sure where that’s determined?)

I’ll post screenshots if it’ll help.

Hey! Yeah, they’re randomly picked from the four walls in the image that comes with it, if you want I could add that as an option as well as an option for Z or Y up. Thanks for finding a solution for that!