Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
0.8.4:volumerendering [2022/05/05 12:36] – [Gamut Mapping] admin | 0.8.4:volumerendering [2022/06/16 13:45] – [Lighting] admin | ||
---|---|---|---|
Line 262: | Line 262: | ||
FFrontFaceRenderPass.FaceKind := TFaceKind.FrontFace; | FFrontFaceRenderPass.FaceKind := TFaceKind.FrontFace; | ||
FFrontFaceRenderPass.Viewport := GorillaViewport1; | FFrontFaceRenderPass.Viewport := GorillaViewport1; | ||
- | FFrontFaceRenderPass.Enabled := true; | ||
// a pre render-pass to get all vertex positions of back faces | // a pre render-pass to get all vertex positions of back faces | ||
Line 268: | Line 267: | ||
FBackFaceRenderPass.FaceKind := TFaceKind.BackFace; | FBackFaceRenderPass.FaceKind := TFaceKind.BackFace; | ||
FBackFaceRenderPass.Viewport := GorillaViewport1; | FBackFaceRenderPass.Viewport := GorillaViewport1; | ||
- | FBackFaceRenderPass.Enabled := true; | ||
// create the volume mesh | // create the volume mesh | ||
Line 277: | Line 275: | ||
FVolume.FrontFaceRenderPass := FFrontFaceRenderPass; | FVolume.FrontFaceRenderPass := FFrontFaceRenderPass; | ||
FVolume.BackFaceRenderPass | FVolume.BackFaceRenderPass | ||
+ | | ||
+ | // only the volume itself should be rendered for front/back face detected | ||
+ | // this will ignore all other objects. | ||
+ | FFrontFaceRenderPass.AllowControl(FVolume); | ||
+ | FFrontFaceRenderPass.Enabled := true; | ||
+ | FBackFaceRenderPass.AllowControl(FVolume); | ||
+ | FBackFaceRenderPass.Enabled := true; | ||
| | ||
// configure some settings | // configure some settings | ||
Line 353: | Line 358: | ||
|Gamut|Texture used for mapping the 3D value during Raytracing| | |Gamut|Texture used for mapping the 3D value during Raytracing| | ||
|GamutMode|Defines when and how the value-color mapping happens. Here different modes are available: GamutNone, GamutByValue, | |GamutMode|Defines when and how the value-color mapping happens. Here different modes are available: GamutNone, GamutByValue, | ||
- | |GamutFactor|A factor applied to the absolute 3D value before mapping onto the gamut texture (default value is 1.0)| | + | |GamutFactor|A factor applied to the absolute 3D value before mapping onto the gamut texture (default value is 1.0). Use this value for shifting inside of the gamut texture. |
+ | |GamutIntensity|Defines how intense coloring is.| | ||
+ | |GamutAlphaIntensity|Defines how intense alpha channel coloring is.| | ||
+ | |||
+ | {{youtube> | ||
- | {{youtube> | ||
=== Modes === | === Modes === | ||
Line 367: | Line 375: | ||
|GamutBySum|Gamut mapping will be applied to the final casted ray value.| | |GamutBySum|Gamut mapping will be applied to the final casted ray value.| | ||
|GamutBySumMultiply|Gamut mapping will be applied to the final casted ray value and afterwards multiplied with the previously computed color value.| | |GamutBySumMultiply|Gamut mapping will be applied to the final casted ray value and afterwards multiplied with the previously computed color value.| | ||
+ | |||
+ | ===== Lighting ===== | ||
+ | |||
+ | Since v0.8.4.2314 lighting and iso surface detection is also supported. | ||
+ | |||
+ | To activate lighting for a volumetric mesh, please use: | ||
+ | <file pascal> | ||
+ | GorillaVolumetricMesh1.UseLighting := true; | ||
+ | </ | ||
+ | |||
+ | Iso surface detection tries to evaluate a surface during raytracing. | ||
+ | |||
+ | Because this method always depends on the data, you can control this detection by **IsoSurfaceLimit** property. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | <file pascal> | ||
+ | GorillaVolumetricMesh1.IsoSurfaceLimit := 0.125; | ||
+ | </ | ||
+ | |||
+ | When detection of a volume surface was successful, we are able to apply lighting with all available shading models to it. | ||
+ | |||
+ | The volumetric mesh therefore allows to choose between: Lambert, Phong, Blinn-Phong and PBR. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | <file pascal> | ||
+ | GorillaVolumetricMesh1.ShadingModel := TGorillaShadingModel.smPBR; | ||
+ | </ | ||
+ | |||
+ | __Notice:__ For PBR (physically based rendering) it does not need any PBR texture, instead it will use the //AOBias//, // | ||
+ | |||
+ | |||
+ | {{youtube> | ||
+ | |||
+ | ===== Filtering and MipMaps ===== | ||
+ | |||
+ | Since v0.8.4.2314 switching between nearest and linear filtering is supported. | ||
+ | You are also able to activate MipMaps, but in most test cases the result was unsatisfying. | ||
+ | |||
+ | {{: | ||
+ | |||
+ | The picture above is showing difference between nearest (left) and linear (right) filtering. | ||
+ | In most cases linear filtering is the expected output, but for some customers exact display of 3D data values is necessary. | ||
+ | |||
+ | <file pascal> | ||
+ | GorillaVolumetricMesh1.LinearFiltering := true; | ||
+ | GorillaVolumetricMesh1.MipMaps := true; | ||
+ | </ | ||
+ | |||
+ | |||
===== Multiple VolumetricMeshes / Complex Scenes ===== | ===== Multiple VolumetricMeshes / Complex Scenes ===== | ||
Line 390: | Line 449: | ||
// exclude all other volumetric meshes or other objects - that the render pass only renders the relevant volume | // exclude all other volumetric meshes or other objects - that the render pass only renders the relevant volume | ||
- | FFrontFaceRenderPass1.IgnoreControl(FVolume2); // !!! only compute Volume #1 | + | FFrontFaceRenderPass1.AllowControl(FVolume1); // !!! only compute Volume #1 |
FFrontFaceRenderPass1.Enabled := true; | FFrontFaceRenderPass1.Enabled := true; | ||
Line 398: | Line 457: | ||
// exclude all other volumetric meshes or other objects - that the render pass only renders the relevant volume | // exclude all other volumetric meshes or other objects - that the render pass only renders the relevant volume | ||
- | FBackFaceRenderPass1.IgnoreControl(FVolume2); // !!! only compute Volume #1 | + | FBackFaceRenderPass1.AllowControl(FVolume1); // !!! only compute Volume #1 |
FBackFaceRenderPass1.Enabled := true; | FBackFaceRenderPass1.Enabled := true; | ||
Line 411: | Line 470: | ||
// exclude all other volumetric meshes or other objects - that the render pass only renders the relevant volume | // exclude all other volumetric meshes or other objects - that the render pass only renders the relevant volume | ||
- | FFrontFaceRenderPass2.IgnoreControl(FVolume1); // !!! only compute Volume #2 | + | FFrontFaceRenderPass2.AllowControl(FVolume2); // !!! only compute Volume #2 |
FFrontFaceRenderPass2.Enabled := true; | FFrontFaceRenderPass2.Enabled := true; | ||
Line 420: | Line 479: | ||
// exclude all other volumetric meshes or other objects - that the render pass only renders the relevant volume | // exclude all other volumetric meshes or other objects - that the render pass only renders the relevant volume | ||
- | FBackFaceRenderPass2.IgnoreControl(FVolume1); // !!! only compute Volume #2 | + | FBackFaceRenderPass2.AllowControl(FVolume2); // !!! only compute Volume #2 |
FBackFaceRenderPass2.Enabled := true; | FBackFaceRenderPass2.Enabled := true; | ||