Solid Wood in Rhino 8

The mapping of this material seems off in Rhino 8 Cycles.

System Info

Rhino 8 SR2 2023-11-29 (Rhino 8, 8.2.23333.09481, Git hash:master @ f86ef9263572569e355077b20611612127c1a79a)
License type: Evaluation, build 2023-11-29
License details: Cloud Zoo
Expires on: 2024-01-30

Windows 11 (10.0.22621 SR0.0) or greater (Physical RAM: 64Gb)
.NET 7.0.11

Computer platform: LAPTOP - Plugged in [95% battery remaining]

Non-hybrid graphics configuration.
Primary display and OpenGL: NVIDIA RTX A3000 12GB Laptop GPU (NVidia) Memory: 11GB, Driver date: 10-4-2023 (M-D-Y). OpenGL Ver: 4.6.0 NVIDIA 537.58
> Integrated accelerated graphics device with 4 adapter port(s)
- Secondary monitor is laptop’s integrated screen or built-in port
- Windows Main Display attached to adapter port 1
Primary OpenGL: NVIDIA RTX A3000 12GB Laptop GPU (NVidia) Memory: 11GB, Driver date: 10-4-2023 (M-D-Y). OpenGL Ver: 4.6.0 NVIDIA 537.58
> Integrated accelerated graphics device with 4 adapter port(s)
- Secondary monitor is laptop’s integrated screen or built-in port
- Windows Main Display attached to adapter port 1

OpenGL Settings
Safe mode: Off
Use accelerated hardware modes: On
Redraw scene when viewports are exposed: On
Graphics level being used: OpenGL 4.6 (primary GPU’s maximum)

Anti-alias mode: 8x
Mip Map Filtering: Linear
Anisotropic Filtering Mode: High

Vendor Name: NVIDIA Corporation
Render version: 4.6
Shading Language: 4.60 NVIDIA
Driver Date: 10-4-2023
Driver Version: 31.0.15.3758
Maximum Texture size: 32768 x 32768
Z-Buffer depth: 24 bits
Maximum Viewport size: 32768 x 32768
Total Video Memory: 11520 MB

Rhino plugins that do not ship with Rhino
C:\Users\Czaja\AppData\Roaming\McNeel\Rhinoceros\8.0\Plug-ins\Bella (813de3fb-18eb-405f-bfcd-b0b4d3da91fb)\23.3.0.0\bella_rhino.rhp “Bella” 23.3.0.0
C:\Users\Czaja\Desktop\Rhino_7_Win_2023.0417\HDRLightStudioTexture.rhp “HDRLightStudioTexture”
C:\Program Files\Common Files\McNeel\Rhinoceros\8.0\Plug-ins\Crayon (39629248-4fa6-47b8-83c7-745a7efea259)\1.2.0.0\Crayon\Crayon.rhp “Crayon” 1.0.0.0
C:\Users\Czaja\AppData\Roaming\McNeel\Rhinoceros\packages\8.0\SubstanceImporter\2.0.3\Substance.Win.rhp “SubstanceImporter” 2.0.3.0
C:\ProgramData\McNeel\Rhinoceros\7.0\Plug-ins\Datasmith Rhino Exporter (d1fdc795-b334-4933-b680-088119cdc6bb)\DatasmithRhino7.rhp “Datasmith Exporter” 5.3.2.0

Rhino plugins that ship with Rhino
C:\Program Files\Rhino 8\Plug-ins\Commands.rhp “Commands” 8.2.23333.9481
C:\Program Files\Rhino 8\Plug-ins\rdk.rhp “Renderer Development Kit”
C:\Program Files\Rhino 8\Plug-ins\RhinoRenderCycles.rhp “Rhino Render” 8.2.23333.9481
C:\Program Files\Rhino 8\Plug-ins\rdk_etoui.rhp “RDK_EtoUI” 8.2.23333.9481
C:\Program Files\Rhino 8\Plug-ins\NamedSnapshots.rhp “Snapshots”
C:\Program Files\Rhino 8\Plug-ins\MeshCommands.rhp “MeshCommands” 8.2.23333.9481
C:\Program Files\Rhino 8\Plug-ins\RhinoCycles.rhp “RhinoCycles” 8.2.23333.9481
C:\Program Files\Rhino 8\Plug-ins\RhinoCode\RhinoCodePlugin.rhp “RhinoCodePlugin” 8.2.23333.9481
C:\Program Files\Rhino 8\Plug-ins\Toolbars\Toolbars.rhp “Toolbars” 8.2.23333.9481
C:\Program Files\Rhino 8\Plug-ins\3dxrhino.rhp “3Dconnexion 3D Mouse”
C:\Program Files\Rhino 8\Plug-ins\Displacement.rhp “Displacement”
C:\Program Files\Rhino 8\Plug-ins\SectionTools.rhp “SectionTools”

solid material.3dm (264.0 KB)

Rendered

Cycles

Bella 23.3.0.0

@jdhill Should this material work with Bella? Solid procedural material + hyperrealistic Bella renderer could be an awesome combo.
This solid material is a cool concept however, in 2023 it looks a little dated / fake, still curious about the possible results.

it should work, but for some reason no texture is being generated – thanks for the file, I’ll check it out

here is v7 versus v8 in the rendered viewport

v7

v8

it turns out the settings of the material have entered a case where there is a bug, which is causing the texture not to be generated – changing the material’s reflectivity to 0 should give you this, here in v7 and v8

v7

v8

so, it seems we see a similar mapping discrepancy in bella – here is cycles in v7 and v8

v7

v8

going to keep looking into this a bit more

FWIW Cycles no longer gets baked textures, but rather has procedurals implemented natively as shader nodes.

For Cycles to do better handling of mapping probably useful to actually natively implement Rhino’s mappings as well.

@Jussi_Aaltonen do you think the mapping differences could be related to your UV work recently?

Yes, they may well be. I need to take a look at the file.

There seems to be some sort of issue with the procedural in Cycles. It is also visible on a plane that simply uses the surface parameter mapping.
RH-78705 Raytraced: procedural texture not quite right

here is a test file using 3d procedural, bitmap texture, and 2d procedural, in mapping & wcs modes

mapping-tester-v6.3dm (3.3 MB)

in my current code I am using my own rendertime cubic/planar projections if RenderTexture.GetProjectionMode() returns Wcs or WcsBox, and otherwise using uvs; I am returning this from BakeFor()

    const BakingFunctions _bakeFor =
          BakingFunctions.Decals
        | BakingFunctions.ProceduralTextures
        | BakingFunctions.CustomObjectMappings
      //| BakingFunctions.WcsBasedMappings
      //| BakingFunctions.MultipleMappingChannels
        | BakingFunctions.NoRepeatTextures
        ;

I use RenderTexture.SimulatedTexture(Allow) along with repeat/offset/rotation from the RenderTexture or reading “rdk-texture-offset” and friends from the Fields if present, and these are the results I am getting in versions 6/7/8

v6

v7

v8 → here we can see something working differently with the 3d procedural, it seems it is only baked to a 2d surface as for a texture thumbnail

Bella doesn’t get baked textures for the objects with that wood procedural. RH-78706 Procedural textures not baked for Bella Render

Looks like the issue here is the same that I just logged for the other model. So you can test if running ToggleGpuProcedurals fixes the issue there.

looks like that does the trick

Is this something you’re working on at the moment. I made some changes for Rhino 8.3 to use box and planar mappings instead of WcsWcs box when possible to reduce the need for texture baking. There are these cases where that is not possible:

  • Something else that requires baking
  • Texture UVW transform has rotation or non-uniform scaling

It is even better if your code works and Bella can do Wcs projections. Just leave the BakingFunctions.WcsBasedMappings flag out as you have done in the code snippet.

yes this is something I have been working on recently (i.e. it is not in the current bella release), exactly as you say, to do our own projections when possible and hopefully cut down on textures being baked

so the code I currently have is as I described, relying on GetProjectionMode() to decide what to do, so hypothetically it should just work with whatever changes you are making there internally

Great news! Yes, that sounds correct

I’m seeing issues with my version of Bella in Rhino 8. Are you aware of these? If so have you already got help solving them?
Some error messages in the command history and missing objects in the render result.

those are pretty serious messages, but I am not seeing them here on rhino 8.1.23325.13001

in theory it should mean those change queue overrides are being called outside of a NotifyBeginUpdates/NotifyEndUpdates pair

(it is really late here, I’ll be back after some hours)

I confirm that those issues do not happen with 8.1.23325.13001.
Filed a bug for our team to investigate: RH-78709 Bella outputs error messages and fails to render objects

1 Like

RH-78709 is fixed in Rhino 8 Service Release 2

Hi @jdhill
Those “Bellta [ERROR]…” messages were caused by code I added to Rhino in order to give users a chance to cancel rendering if texture baking was taking too long. That issue never got into a public service release. I need to figure out why it breaks Bella before enabling that feature again.

So I’ve been running Bella quite a bit lately to test stuff. One issue that I’ve noticed is that when Bella starts a final render it creates the ChangeQueue passing in bNotifyChanges = true. bNotifyChanges should be true only for real time display modes and other applications that need to keep up with changes to the document.
The reason why I noticed this is because the texture baking creates a very low resolution texture to start with and then continues running in the background to generate a higher quality one - this is how it works for real time renderers to make updates snappier.
I also filed a bug for this with steps to repeat: RH-79145 Bella Render: uses asynchronous texture baking for final renders

thanks Jussi, I can’t say offhand whether that is being done deliberately (i.e. to obtain/avoid some behavior), so I’ll check and see how things work if I change it

1 Like

I confirm bNotifyChanges was set to true in the case of modal rendering, and that it appears working fine to pass false, so unless more testing finds some case where it doesn’t (seems unlikely, but then I support v6/7/8 from the same plugin), you can assume this will be changed

and on the topic of changes, I published a new build yesterday, so if you are testing things you may want to switch to that (available here as usual). This build includes changes mentioned above, e.g. it is now using bella projections to implement wcs

not sure if this all obviates the question of change queue “apply” override calls being made outside NotifyBegin/EndUpdates pairs, but at any rate it seems to me that needs to be a guarantee

in my case, my engine/scene api supports changes to individual attributes in the scene without any synchronization by the caller, but I use the begin/end updates to bracket bulk changes, and if I can’t trust them to be called in pairs, then the best I will be able to do is bracket changes for each call of each “apply” override, which I expect (long time since I have instrumented exactly what/when you guys call) should substantially degrade responsiveness

and I would have to wonder why the NotifyBegin/EndUpdates calls exist at all; so that’s just how it looks from here anyway

Thanks, I will test the new build soonish.

Thanks, this was actually very useful information to me. I understand now how I broke the change queue in the development branch and caused those error messages. You shouldn’t need to change anything in Bella. Let me check if your assumptions are correct.