trevorsandy / lpub3d

An LDraw™ editor for LEGO® style digital building instructions.
https://trevorsandy.github.io/lpub3d/
130 stars 19 forks source link

Difference in rendering with native renderer between versions #731

Closed jacovandermolen closed 10 months ago

jacovandermolen commented 1 year ago

Subject

Difference in rendering with native renderer between versions

Environment

There is a difference in rendering with native renderer between versions, same settings and same PC. I'd like to see the latest versions render like the 2.4.5x versions? For reference see these images.

31134 - Space Shuttle_150_DPI_page_1_2 4 7r2 31134 - Space Shuttle_150_DPI_page_1_2 4 5r62 31134 - Space Shuttle_150_DPI_page_1_2 4 5r144

trevorsandy commented 1 year ago

For reference see these images.

Was the first image taken from 2.4.7.r2, the second from 2.4.5.r62 and the third from 2.4.5.r144 ?

What is the main difference you are seeing ? Is it the model scale, lines or level of detail ?

Cheers,

jacovandermolen commented 1 year ago

Yes, sorry, in that order. The main difference is the level of detail I guess. 2.4.7 is somewhat blurry, more anti-aliased? 2.4.5 lines are sharp. Line on black part is white, where the outline in 2.4.7 on black part is more light grey. There is a scale difference between 2.4.5.62 and 144 and shape of PLI differs. Why is that?

trevorsandy commented 1 year ago

Thank you for the details.

For comparison, can you share the simple model file (and header file if applicable) used to generate the images above ?

Cheers,

jacovandermolen commented 1 year ago

Sure, here it is. FYI: I am busy doing some demos again regarding LDraw: modelling with LDCad and then making instructions with LPub3D. WIP on the 31134 3-in-1 creator set 31134 - Space Shuttle.mpd.txt header.ldr.txt

I am also curious how this renders with the latest releases of LPub3D. I am getting some errors here and there.

jacovandermolen commented 1 year ago

Here are the "helpers" for the arrows Helpers.zip put in C:\Users\Public\Documents\LDraw\Unofficial or similar.

trevorsandy commented 1 year ago

Excellent. Many thanks.

jacovandermolen commented 10 months ago

Have you found a way to correct this? I want to try the new versions but if they render like they do now, I cannot work with it.

trevorsandy commented 10 months ago

Oops, I completely overlooked this ticket.

I'll take a look.

Cheers,

jacovandermolen commented 10 months ago

Tnx!

trevorsandy commented 10 months ago

If you are running a portable distribution, can you send a copy of the LPub3D.ini so I can compare your settings with mine ? Thanks.

Cheers,

jacovandermolen commented 10 months ago

I found out version 2.4.5.62.3270_20221207 renders correct, atleast the way I want with the native rendere both perspective as orthographic. This is its ini. LPub3D - kopie.ini.txt

jacovandermolen commented 10 months ago

OK, something strange is going on with the PC that produces the other rendering. My laptop at home now renders like I want in both ortho and perspective mode with the native renderer using the latest build 2.4.7.r72.

So only you have the slightest idea what is causing the behavior, you can close this issue. Seems related to my PC at work.

trevorsandy commented 10 months ago

So only you have the slightest idea what is causing the behavior, you can close this issue. Seems related to my PC at work.

Very well.

There is a scale difference between 2.4.5.62 and 144 and shape of PLI differs. Why is that?

At some point after 2.5, I changed the camera default distance factor - I can't remember exactly, I'll have to look up the commits to tell exactly at what rev.

An editor can set/change the default 'factor' to align the size of rendered images between the Native renderer and LDView/LDGLite. If you can check this setting (3DViewer Preferences) on 2.4.5.r62 and it is different from 2.4.7.r72, this will likely be the reason for the size change.

Further, the rendered image size change will affect the calculated width and height of the PLI background; hence, the difference there.

You can see more details in the 'What's this' (?) help link at the top right of the dialog - See #618.

Default_Size_01

Cheers,

jacovandermolen commented 10 months ago

OK, I see. The size difference I can live with ;-)

The one thing I do not understand is the way the outlines are rendered. Anything on that?

trevorsandy commented 10 months ago

The one thing I do not understand is the way the outlines are rendered. Anything on that?

Under Global Project Setup: Outlines_01

Stud Style and Automate Edge Color:

Outlines_02

Have you looked at Automate edge colors ?

Outlines_03_Automate_Edge_Colours

And High-contrast stud style color settings ?

Outlines_04_HC_Edge_Colours

Cheers,

jacovandermolen commented 10 months ago

Yes, all of those settings are set. They are included in the header.ldr file I use for most of my models. Left is 2.4.5 r26 Right 2.4.7 r72 Same settings, same computer main-0_1_0_0_0_1_0_0_0_1_1_1753_150_DPI_1 3_30_37_55_0_180_0_RELmain-0_1_0_0_0_1_0_0_0_1_1_1753_150_DPI_1 3_30_37_55_0_180_0_REL

trevorsandy commented 10 months ago

The one thing I do not understand is the way the outlines are rendered. Anything on that?

No. For me, there is no edge line difference between v2.4.5r26 and v2.4.7 latest.

v2.4.5r26 731_v2 4 5r26

v2.4.7r72 731_v2 4 7r72

On the other hand, I was able to identify the reason for the difference in rendered image size. There is an arbitrary FOV adjustment for Native rendered images that was exposed in the LPub3D.ini file as NativeImageCameraFoVAdjust with a default value of 6. In v2.4.6, this adjustment was changed to 15 (hence the smaller images) and set as a macro so it is no longer exposed in the LPub3D.ini. If you wish to adjust the rendered size of your images, use the CAMERA_FOV meta command.

The v2.4.7r72 image above is achieved with 0 !LPUB ASSEM CAMERA_FOV 20 (the default FOV for the Native renderer is 30).

In the next release, I will restore NativeImageCameraFoVAdjust to the LPub3D.ini, but the default value will remain 15. You will only be able to directly change the LPub3D.ini setting (e.g. back to 6) if you so desire - no UI will be available.

Cheers,

jacovandermolen commented 10 months ago

Great! Thank you.