Add Physics Based Rendering (PBR) shading method to grdimage and grdview - #9230
Conversation
Summary of changed imagesThis is an auto-generated report of images that have changed on the DVC remote
Image diff(s)DetailsAdded images
Modified images
Report last updated at commit af7f78b |
| **-F**\ *azim*/*elev*\ [**+f**\ *fill*][**+i**\ *ior*][**+l**\ *light*][**+m**\ *metallic*][**+o**\ [*radius*]][**+r**\ *roughness*][**+s**][**+t**][**+v**\ *ve*] | ||
| Shade the grid with physically based lighting instead of illuminating it with |-I| (the two | ||
| cannot be combined). The shaded image is made on the grid's own nodes and then projected and | ||
| plotted as any image, so |-A|, |-E| and |-J| work as usual. Use **-I+f** as a short form that |
There was a problem hiding this comment.
The new shading looks good, but why support -I+f? Can we just use -F with no arguments to mean using the default settings?
There was a problem hiding this comment.
The idea was to give the -I, that I believe is very embedded in users memory, a quick shortcut to also use this new illumination. But you are right that at least, -F should do that too. To be honest, I don't even like the idea to introduce a new letter to do illuminations but at the time the idea to overload the -I with all new -F flags seemed bad idea. But now I'm not so sure anymore. What do you guys think of dropping -F and letting -I take the extra burden like in (the P is from the PBR method name)
-I+P[azim/elev+...]
There was a problem hiding this comment.
What do you guys think of dropping -F and letting -I take the extra burden like in (the P is from the PBR method name)
The two shadings have totally different modifiers. Combining them into one flag will make the documentation difficult to read.
There was a problem hiding this comment.
So -F and -I are mutually exclusive, or is -F a modifier for -I? (I see now that the docs says ‘cannot be combined’). Adding a new option (-F) for illumination might be confusing, but so is creating a -I monster with dizzying amount of modifiers. What confuses the least..?
There was a problem hiding this comment.
Ps: very nice to see a new illumination method!
There was a problem hiding this comment.
Andreas, you summarized it well. What confuses less?
There was a problem hiding this comment.
No strong opinion here, but I lean towards -F. It might also help to add a cross-reference in the -I docs pointing to the -F shading method, so users searching under either option find the other.
There was a problem hiding this comment.
Adding a new option (-F) for illumination might be confusing, but so is creating a -I monster with dizzying amount of modifiers. What confuses the least..?
I think adding the new feature into -I is more confusing. With so many modifiers, it would be very confusing that which modifiers controls the normal shading, and which modifiers belong to the new shading.
There was a problem hiding this comment.
Ideally, I prefer adding it to -I ('all illumination is given by -I'), but in practice, as you're saying, it's probably best to create the -F option.
There was a problem hiding this comment.
If we were going to reuse the -I we it have to show up in the docs in a way similar to this
- -I[file|intens|+aazimuth][+d][+mambient][+nargs]
or, for PBR shading - -I+P[azim /elev][+f fill ][+i ior ][+l light ][+m metallic ][+o[ radius ]][+r roughness ][+s][+t][+v ve ]
Maybe this would not be very confusing. And to be honest I would even drop from the docs the [+mambient][+nargs] from first form. It is far from clear whet they do and I doubt any one is using it.
Let the full -F be also set via -I+P[...]
|
I have updated the PR so we can try better the -I, -F functionality. Now both For some reason I can no longer build any documentation. |
|
I'm leaning to strip the -F option and leave the PBR shading on -I like I explained above. Please say if still think that it makes -I too confusing. As I said unfortunately I cannot rebuild the docs anymore so can't see how the |
|
Ok, no voices against this |



PBR is a shading method used by the VTK library in GPU rendering. In
i'GMTI managed to had it replicated (almost) in C and this PR ports it into GMT. The shading quality of this method seems rather more appealing than what we have so far. It is implemented ingrdimageandgrdviewas option -F and a shortcut -I+f can be used to that resorts to default values (maybe these def values can be tuned). Code was accelerated with OMP and runs rather rapidly in spite having to do quite some more work than the pure gradient methods we have in GMT so far.As an example, this
produces this image (notice the presence of shadows)