Questions regarding simplepbr after a year of usage

I believe simplepbr is a very cool addition to Panda3D and it has been beneficial for my typical use case of rapid prototyping.

I do have a handful of questions regarding simplepbr’s usage and internal logic, and I’d like to offer a small piece of my own experience working with shaders in Panda3D.

Questions:

  1. Why doesn’t simplepbr support CommonFilters? In my experience, simplepbr cannot find a display region to filter, causing the shaders to fail. Custom shaders based on simplepbr can utilize CommonFilters, so I do not see why simplepbr itself cannot.

  2. Why doesn’t simplepbr support PandaNode level shader applications? At least in my own work, and in the work I have seen from other users Panda3D code, this is a core OpenGL feature that should be exposed.

  3. Why is there a preference for a negative vert normalization, with no option for a positive one in the frag shader? This can cause light attenuation issues on NVIDIA hardware specifically, without discretizing these two options into separate shaders applied to different nodes (at least, this is my solution, maybe others exist).

  4. Why doesn’t simplepbr support Panda3D clip planes? This can be added using a uniform vec4 clip_plane_def and a simple

    if (dot(v_world_pos, clip_plane_def.xyz) > clip_plane_def.w) {
        discard;
    }

(credit for this clip code goes to @Epihaius )

  1. How about adding some GLSL parallax-mapping support? This link for instance may be instructive: parallax-mapping/parallax.frag at master · piellardj/parallax-mapping · GitHub

I appreciate all the great work currently being done with Panda3D, and thank you for taking the time to consider the aforementioned issues.

1 Like

I’ll go into specifics, but most of these can be answered by, “no one has brought it up yet and to please file issues.”

  1. This is not intentional. simplepbr already uses FilterManager, so I don’t see why CommoFilters wouldn’t also work. Please file an issue with a minimal repro case.

  2. I am not sure what you’re asking for here; could you please provide an example? I feel like simplepbr should behave close to the autoshader here.

  3. Do you have any links handy for further reading on this? This wasn’t a conscious choice, and I am open to modifications to the shader, but I need to familiarize myself with the topic.

  4. No one has brought this up yet. Feel free to create a PR for it!

  5. Parallax mapping is not a priority for me, so I have not worked on it. However, PRs are welcome.

2 Likes

Thank you for the quick reply!

Since you suggested it, I will put some thought into constructing a PR or two for these issues. It may take a bit of work on my part to figure out what’s causing the simplepbr.init() to ignore some part of the CommonFilters setup, and to understand how the shaders are ultimately applied to base.render .

As for reading material, I’m afraid not, however with about an hour of free time I could put together an Issue for it with real in-game examples.

Thanks again.