Bitmap converter to VRayHDRI

Hey,

Just a quick question. Is there any script for 3ds max that could convert all scene bitmaps to tiled .exr or .tx and update all shaders (bitmap → vrayHDRI) ?

I can write it up but maybe someone beat me to it.

Best regards,

Tomasz

vray comes with tiled exr converter already, is that not what you are looking for? In regard to .tx, its not as simple I don’t think there is a free tool out there to do that. Replacing bitmaps to vrayHdr is a separate process, perhaps there is something on scriptspot?

Yep, V-ray has good converter already. I’m thinking about .tx as on option, as from memory consumption and efficiency standpoint tx and exr are the way to go.

If it comes to converting tx, OpenImageIO has neat command line converter.

I couldn’t find any script for Bitmap to vrayHDRI conversion on Scriptspot. I will write an simple script and share it If there isn’t anything like that.

Yeah .tx is much better we use it all the time. It’s less memory and .tx supports rang of 8-16-32 bits, where are exr is only 16 or 32. We used open image io to compile our own libs, so I think you would need to do the same.

maketx from OpenImageIO is free and you can find it compiled from a number of sources (f.e. here: https://code.google.com/p/osspack32/downloads/detail?name=maketx.exe&can=2&q=); I guess that you can look at the V-Ray bitmap converter script and replace the calls to our own img2tiledexr tool with calls to maketx - look for “vrayBitmap2VRayHDRI” in “C:\Program Files\Autodesk\3ds Max 2014\scripts\Startup\vrayutils.ms”

Best regards,
Vlado

That’s perfect Vlado. I totally missed that script inside max. Don’t ask how… This is probably the one Morbid Angel was referring to, but I had this command line one in mind all the time :wink:

Anyway, I will expand it with tx support and it will do the job.

Best regards,
Tomasz Wyszolmirski

Max/VRay can read Tx files?
I thought that was an old Mentalray format that had to be “force” loaded into shaders circumventing the standard bitmap loader in max?

Through VRayHDRI, yes.

I thought that was an old Mentalray format that had to be “force” loaded into shaders circumventing the standard bitmap loader in max?I don’t think so; mental ray does have its own .map format (I think that’s what it is called), but .tx/.tex (which is actually tiled TIFF) has been a RenderMan thing historically.

Best regards,
Vlado

Oh. yes. Sorry…I have totally forgotten. I haven’t touched Renderman in quite a few years.
Though the .map format is aimed at exactly this use is it not?
Is there a way to save tx files from Photoshop, or would one need to use the command prompt for this every time?

This is the purpose of the .map format, yes. However it’s a closed format specific to mental ray.

I doubt that PhotoShop can write tiled mip-mapped files though.

Best regards,
Vlado

Would you guys be willing to expand/transform the vrayhdrimap to become a more general purpose bitmap loader supporting all bit depths, and implement some kind of compression system for the tiled functionality (for the converter too obviously). The map’s functionality seems to have outgrown its name now anyway.
As it is right now, some Exrs become gigantic when converted to tiled images, as if the original compression of the exr (which can be quite impressively effective) is discarded when tiled.

Edit: Hmm. Come to think of it, there a quite a few things I’d love to see added/updated/cleaned up regarding how things are done in max (and then in effect VRay), that One would probably be better off doing these types of things separately in a new node or similar.
Feel free to disregard this as nonsense

VRayHDRI is a general purpose bitmap loader supporting various bit depths.

The map’s functionality seems to have outgrown its name now anyway.This is quite true, yes. Too late to change the name though :slight_smile:

As it is right now, some Exrs become gigantic when converted to tiled images, as if the original compression of the exr (which can be quite impressively effective) is discarded when tiled.The compression is not discarded, however keep in mind that all mip-map levels are also stored in the file, which means it stores twice as much data as the original.

Edit: Hmm. Come to think of it, there a quite a few things I’d love to see added/updated/cleaned up regarding how things are done in max (and then in effect VRay), that One would probably be better off doing these types of things separately in a new node or similar.Can you elaborate?

Best regards,
Vlado

Heh. Well I’ll try to condense my rambling brain activity after the Christmas holidays. Planning on unloading all render-related stuff from my brain if possible this Christmas.

Hehe very good approach! Have fun then :slight_smile:

Best regards,
Vlado

After converting to tiled EXR, should this be viewable in Photoshop? I can’t see the pyramid tiles.

Photoshop probably doesn’t read the mip-map levels, just the most detailed original one.

Best regards,
Vlado

Any ideas whether there is a way to edit or use a manually created mipmap?

I have seen custom created maps with different images for the different mip-map levels (we have even used such files for testing V-Ray’s ray differentials), but the only way that I know of to create them is programmatically in C++ by directly interfacing with f.e. the OpenEXR or TIFF libraries.

Best regards,
Vlado

Is there any chance you guys could let users have one?

I wanted to run some tests using a numbered or colour coded mipmap so I can see whih levels are being selected.

I found in general that the tiles exrs render faster. I assumed this would also be a good method to use for leaves on trees however I found in both vray and mr this I be slightly slower than a regular map.

I have a couple of questions regarding mipmapping:

- Can anyone shed any light as to scenarios where mipmapping will always result in a faster render?

- I am having mixed results on some test scenes and I can’t see a pattern - sometimes it will be faster, sometimes not. It’s always slower when mipmapping leaves of a tree.

- Would converting-to-tiled-exr only be no-brainer on scenes that are maxing out Vrays dynamic memory limit?

I assumed that by removing the bitmap filtering process from rendering, it should always be faster. I’ve tried Vrays exr to tiled HDR converter and maketx.exe.