MaxToLux - Autodesk 3ds Max Integration for LuxCoreRender

Discussion related to the LuxCore functionality, implementations and API.
User avatar
TAO
Developer
Developer
Posts: 851
Joined: Sun Mar 24, 2019 4:49 pm
Location: France
Contact:

Re: MaxToLux - 3ds Max Integration for LuxCore

Post by TAO »

This is how I add an image as a texture map then add it to normal texture and finally apply it to the material.

Code: Select all

scene.textures.Map_2.type = imagemap
scene.textures.Map_2.file = E:\Brick_Normal.jpg
scene.textures.Map_2.mapping.uvscale = 1.0 1.0
scene.textures.NormalMap_2.type = normalmap
scene.textures.NormalMap_2.texure = Map_2
scene.textures.NormalMap_2.scale = 1.0
scene.materials.Material_2.normaltex = NormalMap_2
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: MaxToLux - 3ds Max Integration for LuxCore

Post by B.Y.O.B. »

The output of a normalmap texture should be plugged into the "bumptex" slot of the material, not the "normaltex" slot.
User avatar
TAO
Developer
Developer
Posts: 851
Joined: Sun Mar 24, 2019 4:49 pm
Location: France
Contact:

Re: MaxToLux - 3ds Max Integration for LuxCore

Post by TAO »

So we can use bump or normal and not both at the same time.
And what about .normaltex ?
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: MaxToLux - 3ds Max Integration for LuxCore

Post by B.Y.O.B. »

.normaltex defines an implicit normalmap texture: https://github.com/LuxCoreRender/LuxCor ... s.cpp#L165
TAO wrote: Sat May 02, 2020 12:48 pm So we can use bump or normal and not both at the same time.
You can use both. You just need to combine them before plugging the result into the .bumptex slot.

For example, like this:
(multiply = scale texture in LuxCore).
Attachments
Screenshot from 2020-05-02 15-03-41.png
User avatar
TAO
Developer
Developer
Posts: 851
Joined: Sun Mar 24, 2019 4:49 pm
Location: France
Contact:

Re: MaxToLux - 3ds Max Integration for LuxCore

Post by TAO »

Thank you for that suggestion, I'll gonna try that.
But I still struggle with the old issue.
Any kind of bump especially with a bit high value will cause the same problem. Check this if you can find anything wrong with it.

Code: Select all

scene.textures.Map_2.type = imagemap
scene.textures.Map_2.file = E:\Brick_Normal.jpg
scene.textures.Map_2.mapping.uvscale = 1.0 1.0
scene.textures.NormalMap_2.type = normalmap
scene.textures.NormalMap_2.texure = Map_2
scene.textures.NormalMap_2.scale = 0.01
scene.materials.Material_2.bumptex = NormalMap_2
With above code in 3dsmax.almost no bump.
002.jpg
Same code higher scale 0.2
001.jpg


Almost the same result in LuxcoreGUI.
000L.jpg
Scale 0.01
001L.jpg
Scale 0.2

Code in Scene.scn

Code: Select all

scene.textures.NormalMap_2.type = "normalmap"
scene.textures.NormalMap_2.texture = "Implicit-ConstFloatTexture-2d160e07-bc9d-4a1a-a08c-e971e77a3bb9"
scene.textures.NormalMap_2.scale = 0.2
scene.materials.Material_2.type = "matte"
scene.materials.Material_2.kd = "Map_0"
scene.materials.Material_2.id = 10034367
scene.materials.Material_2.bumptex = "NormalMap_2"
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: MaxToLux - 3ds Max Integration for LuxCore

Post by B.Y.O.B. »

Make sure you set the gamma of your bump- and normalmaps to 1.

Regardless, since bump height is in meters, it depends on your objects size how much bump makes sense before it leads to problems.
If your object is 1 m in diameter, then a bump height of 20 cm is crazy and much too high (and it is expected that it leads to the result you see, i.e. heavy terminator issues).
User avatar
TAO
Developer
Developer
Posts: 851
Joined: Sun Mar 24, 2019 4:49 pm
Location: France
Contact:

Re: MaxToLux - 3ds Max Integration for LuxCore

Post by TAO »

0212.jpg
Why I can't feel any bump on the teapot. What I'm doing wrong?
Small scale, huge scale, it doesn't work. Only shadow problems with huge numbers.
Regular bump works but NormalMap not so much.

Code: Select all

scene.textures.Map_0.type = imagemap
scene.textures.Map_0.file = E:\Brick_Diffuse.jpg
scene.textures.Map_0.gamma = 1.0
scene.textures.Map_0.mapping.uvscale = 1.0 1.0
scene.materials.Material_2.kd = Map_0
scene.textures.Map_2.type = imagemap
scene.textures.Map_2.file = E:\Brick_Normal.jpg
scene.textures.Map_2.gamma = 1.0
scene.textures.Map_2.mapping.uvscale = 1.0 1.0
scene.textures.NormalMap_2.type = normalmap
scene.textures.NormalMap_2.texure = Map_2
scene.textures.NormalMap_2.scale = 0.05
scene.materials.Material_2.bumptex = NormalMap_2
Brick_Normal.jpg
If I put it on ".normaltex", it will work but the shadow problem on the object remains the same.
User avatar
TAO
Developer
Developer
Posts: 851
Joined: Sun Mar 24, 2019 4:49 pm
Location: France
Contact:

Re: MaxToLux - 3ds Max Integration for LuxCore

Post by TAO »

Just a simple material test and its work as it's intended to.
Of course, there are a few issues and material work only one level deep in sub materials and sub textures part for test reason.
Material.jpg
Annotation 2020-05-12 161020.jpg
Also, I will publish a new build today.
Odd bump and normal bump behavior still persist.
There is a conflict between 3dsmax gamma and LuxCoreRender Gamma.


At this moment I'm working on 2d and 3d textures that completely necessary to be done to create more complex material and shaders.
There are too many textures and I'm a bit busy with no one to help so it may take a bit of time but I'll gonna try my best.
Last edited by TAO on Tue May 12, 2020 12:35 pm, edited 4 times in total.
User avatar
TAO
Developer
Developer
Posts: 851
Joined: Sun Mar 24, 2019 4:49 pm
Location: France
Contact:

Re: MaxToLux - 3ds Max Integration for LuxCore

Post by TAO »

Another material test with a simple caustic effect and more.
Glass.jpg
Cloth.jpg
User avatar
TAO
Developer
Developer
Posts: 851
Joined: Sun Mar 24, 2019 4:49 pm
Location: France
Contact:

Re: MaxToLux - 3ds Max Integration for LuxCore

Post by TAO »

MaxToLux beta V0.0.4 3dsmax 2019
it's still for test use and not for final production.
https://3dfine.com/down/lux/MaxToLux-Beta v0.0.4.zip

Simple Material Scene.
https://3dfine.com/down/lux/MaterialTest.zip
MaterialTest.jpg
What's new :
1- All materials and textures build from the ground
2- The material preview is up to 20 times faster, base on the hardware
3- Black material preview fixed and now material preview can be any size
4- Most basic material options works but some may not work as it suppose to, please report them.
5- OpenCL devices can be detected automatically.
6- The Material preview uses Native CPU now as its much faster with a small scene and does not need any kernel to compile.
7- basic MaxToLux Light added (May Not work correctly yet)
8- basic MaxToLux Camera added (May Not work correctly yet)
9- Auto Denoise will apply to final render
10- If there is no light in the scene default sky and sun will be used as light sources.
11- all materials and shaders are compiled as a single file to load faster in 3dsmax and avoid too much work on tracing and fixing bugs
12- Plugin does not load automatically at 3dsmax and it will load at the calling renderer for best performance.
14- installer shown correctly in windows add/remove the application
15- 3dsmax version and path detection improved in the installer.
and more ....

Limitations and known bugs :
1- Materials and Textures are limited to just one level deep (For test reason)
2- At least one OpenCL device need to be available
3- There is a conflict between MaxToLux and 3ds Max Gamma and can not work at the same time. for best result disable 3dsmax gamma
4- To use Material as a light emitter at least one light needs to be created in the scene.
5- Materials are in the wrong category in the material editor
6- output can only be saved as JPG (not sure why)
7- there is no render pass available yet
8- image map with the too-long path can cause the missing texture file in luxCore, (Just use a simple small path like c:\temp or such for now)

Installation :
1- First, download the new plugin from the above link, Extract it in any place you like.
2- Now remove the old plugin if it is already installed, you need to remove the old plugin trough the old installer or inside Add/Remove program, it may be shown up with name "installer"
3- Now install the new one by double-clicking on Setup.exe, it should automatically detect 3dsmax location and install the plugin and all dependencies that need to be installed.

MaxToLux for 3dsmax 2020 will be released soon.

Please report any issues that not listed in this context.

This build is not a final version and may change in the future so PLEASE do not use it in production and always make a backup of your project before activating MaxToLux, it may not work with the next release.
Last edited by TAO on Sun May 17, 2020 11:18 am, edited 4 times in total.
Post Reply