Render options configurable in editor

render_options_2d
render_options_1
render_options_2

You can now configure RenderOptions of every TCastleScene. Simply access it like MyScene.RenderOptions.OcclusionQuery := true. It is available also in the editor, as you can see on the screenshots ๐Ÿ™‚ All the features are documented in TCastleRenderOptions class, in particular you can:

This mechanism replaces (and deprecates) previous Scene.Attributes.

As part of this rework, we also deprecate or even remove some stuff that had very low usage.

In particular, Scene.Attributes.OnRadianceTransfer and Scene.Attributes.OnVertexColor are now removed. They were causing quite a complication throughout the renderer, and were never ready for โ€œproductionโ€ usage due to being inherently slow (doing per-vertex work on CPU). Their effect can still be achieved by a simple utility that maintains the X3D Color node, updating it every frame. So if you need this (and can accept the slowness of per-vertex processing on CPU) you can still do it, our sceneutilities.pas example unit demonstrates this in practice, and is used by dynamic_ambient_occlusion and radiance_transfer examples. Feel free to reuse SceneUtilities in your projects in you need an upgrade path from the OnVertexColor and OnRadianceTransfer.

1 Like