Dispersion and some other features request for the Advanced Shader
quinyu started this discussion in Model Export and Render

Hello, for the Advanced Shader plugin, could a dispersion feature be also added, at least for the transparent parts? The LEGO Group currently makes those parts of polycarbonate, with the refractive index 1.585 and Abbe number ~34. This means it has a fair amount of dispersion, responsible for a rainbowy effect at extreme angles. (The Abbe number 34 means that it is a fairly high dispersion material, so the visual effect is not negligible.)

The other thing that I wish to request is displacement on decorated tiles. As you know, decorations come in two forms, either factory painted or decalled. Both of these cause an amount of surface displacement, the first less than the second. Decals tend to have their edges white, unless their base material is of course transparent. Could you add these as improvements to the Advanced Shader plugin? (I know dispersion is a computationally intensive task, so there should perhaps be an option for it.)

Thank you

6 replies · Page 1 of 1

For the note, here you can find wavelength-specific refractory indices for polycarbonate: https://refractiveindex.info/?shelf😮rganic&book😛olycarbonate&page😒ultanova

Also... since the update, if exporting to OBJ, the file contains no bump maps, nor are the pieces' material names containing reference to which bump map they should be using, even though this was there previously. I understand that for the plugin it doesn't matter, but come on, I coined in, at least let me use the bitmaps that come packaged with the Advanced Shader plugin in something else, so could you please put this info back? I mean, it's probably easy as 1-2-3 for you, there's no reason to intentionally make the life of the odd ones who use Some Other Evil Software harder, right? 😉 (the decorations I can still pull off, albeit a bit harder than earlier....)

Thank you

Avatar of Scrubs
Administrator

Blender Cycles is not a spectral renderer and therefore there aren't any out of the box solutions for dispersion.
Regarding the displacement request, this is not on the table. Real displacement requires a lot of geometry which would blow the memory required. LEGO rendering already requires a lot of resources and I do not think that exponentially increasing the need for something only visible at very close range is a good solution. This is currently done via normal and bump mapping (for prints and stickers) which is a good compromise.

For obj, this is not as simple as that. The new Mecabricks material system is node based which is obviously something not supported by this format. OBJ also doesn't support multiple uv layers which is a key feature. Therefore, I do my best to export what is possible but here there is no good solution as the uv layers the bump map(s) shall be applied on won't even be exported (technical limitation of the format).

Well, I had done bump as well as real displacement, as a test, in Daz3D, unless there is an extreme amount of geometry subdivision, real displacement won't look as nice - and unless the piece is lit at a very precise and extreme angle, it simply isn't worth it. Perhaps the interesting lighting effects through a transparent piece with such a grainy surface would be something, but I don't expect much. So yes, I agree with you on that account. It should still be possible to name the part differently if it has/would need a bump map, and let the user solve it from there on... which was how they were named in the previous version. Sure enough, they came in completely black when the file was imported, but that wasn't an extreme issue, I had to assign shaders to the pieces one-by-one anyhow.

About dispersion, doing it "right" would probably need things be treated bidirectional, which isn't something Cycles is good at, I agree. Yet, there are certain methods that can be applied to at least fake it, you can see one technique described here. You can skip the first half of the video if you just want to get to the hands-on details. It seems easy enough.
https://www.blendernation.com/2018/08/08/creating-a-dispersion-shader-in-cycles-cgc-weekly-17/
Of course, one could split the spectrum to as many parts as they want, with a little more math, but that would need obviously a lot more calculation time - effectively, if I want the visible spectrum in 64 parts for all that smooth rainbowy thing, the part would need to be effectively rendered 64 times with different RI's, which sounds like an overkill. But still doable.

About the memory requirement, I didn't see issues. Most of my Blender renders so far remain below 2 gigs, and that's good enough. I don't see where the "lots of resources" come in, most contemporary video cards do have that much memory, I guess? I should perhaps try with some monstrously large model next.

Either way, keep up the good work, this page is still a godsend. d (^_^) b

I have calculated the RGB RI for polycarbonate, they're 1.5824 for red, 1.5920 for green and 1.6078 for blue respectively. Just in case you wanna do something like that there.

Avatar of Scrubs
Administrator

Bump maps as existing in the previous part library system do not exist anymore. It is now mask based instead e.g. slope bricks . Only details like mould marks are part of the bump maps and it can be separated across multiple uv layers and textures.

The little Mecabricks render farm rendered more than 100k images. Trust me, 2GB is not enough especially when some parts are subdivided 😉

Thanks for the PC data. It may be useful one day.

Advertising
2 participants
Avatar of Scrubs

LEGO, the LEGO logo, the Minifigure, and the Brick and Knob configurations are trademarks of the LEGO Group of Companies. ©2024 The LEGO Group.

Mecabricks, the Mecabricks logo and all content not covered by The LEGO Group's copyright is, unless otherwise stated, ©2011-2024 Mecabricks.