I've encountered a problem while executing the render_ambient.py code on Linux for rendering.

#4
by SeongYeon - opened
  1. Problem with render image color change
    There was an issue where the rendered output's diffuse and glossy results showed a pinkish hue. Upon investigation, it appears this issue can occur when Blender fails to read the file properly.

  2. What version of Blender is it?
    In the process of deleting the existing render_ambient.blend and trying to reinstall, I encountered the following error.

Blender 4.1.0 (hash 40a5e739e270 built 2024-03-26 00:31:19)
Read blend: "/home/MatSynth/render_ambient.blend"
Warning: File written by newer Blender binary (401.24), expect loss of data!

It seems to be a problem caused by an incompatible version. Please let me know which version of Blender was used with this code.

Thank you.

Hi, about your first problem it should be related to lost reference to the hdri maps. Be sure to keep the same folder structure as shared.
About the version, I used Blender 4.0.1. Loading with 4.1 shouldn't create any problems.
Anyway, I will check the blender file again

Thank you for your response.

I'd like to share in detail the problem I'm having and take your advice as the author.

Currently I have blender 4.1.0 & 4.1.1 installed in a linux environment to render and at first I saw that the file was rendering properly with no color change.

Then my server went down halfway through and I had to run the code again and I ran the code I had run before without making any changes and the color of the rendered result changed to a pinkish color.

I have followed your previous advice to try and resolve this issue, but it hasn't worked yet. So I'll share the path to my current data folder and the command line I used, if you can help me find the problem I'd really appreciate it.

[Folder structure]
image.png

image.png

image.png

Maps
β”œβ”€β”€ train
β”‚ β”œβ”€β”€ Blends
β”‚ β”‚ β”œβ”€β”€ material_name
β”‚ β”‚ β”‚ β”œβ”€β”€ rot_000_crop_000
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ basecolor.png # I rendered it with basecolor, metallic, normal, roughness maps.
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ diffuse.png
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ metallic.png
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ normal.png
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ roughness.png
β”‚ β”‚ β”‚ β”‚ β”œβ”€β”€ specular.png
β”‚ β”‚ β”œβ”€β”€ ...
β”‚ β”œβ”€β”€ Ceramic
β”‚ β”œβ”€β”€ Concrete
β”‚ β”œβ”€β”€ ...
β”œβ”€β”€ test
scripts
β”œβ”€β”€ blender-4.1.0-linux-x64
β”‚ β”œβ”€β”€ blender-launcher
β”œβ”€β”€ hdri
β”œβ”€β”€ render_ambient.py # I modify slightly to fit my data folder structure.
β”œβ”€β”€ ...

[Execution command]
bash .../scripts/blender-4.1.0-linux-x64/blender-launcher -b.../scripts/render_ambient.blend -P .../scripts/render_ambient.py -- .../Maps/train/Blends

Then I will see a message like the one below. And rendered.
Warning: File written by newer Blender binary (401.24), expect loss of data!
Info: No orphaned data-blocks to purge

[Additional attachments]
Images that render well initially. It is diffuse.png

image.png

Images that render incorrectly. It is diffuse.png

image.png

Looking at your image it indeed looks like it is not correctly loading the hdri. Could be that either the hdri or the project were corrupted when your server went down.
If you didn't had the problem before you could just try re downloading both the project and hdri, if you haven't already, and see if anything changes.
Also, if you're not using the displacement for rendering (which looks like you aren't) you don't need the two-pass rendering, but just render in one pass with the perspective camera (would need to make slight changes to the project for that).

It was a bit of a struggle, but with your advice, I was eventually able to fix it. I am very grateful to you.

I've contacted you via email to discuss this further, so I'd really appreciate it if you could confirm.

I did some research on the one-pass rendering you mentioned and applied it to a .blend file and a .py file.

I'm commenting to get your confirmation that I've applied it correctly.

  1. render_ambient.blend
    • Delete the part that takes the Object's displacement map
  2. render_ambient.py
    • Delete the part that takes in the displacement map
    • Delete the part that does two pass rendering and render with camera_data.type = 'PERSP'
    • Attach the code

image.png

Is the way I did it right?

And I have one question about the render_ambient.blend file you uploaded. When I downloaded the file and opened it in Blender, I noticed that Env 0 and Env 3 were the same, so when I modified either Env 3 or 0, I noticed that they both changed at the same time. I don't know if this is just happening to me, but I thought I'd mention it in case you need to check this out.

Sign up or log in to comment