Deferred Pipeline w/ Physically Based Shading

Awesome.

That is very, very impressive. 0_0 Very well done indeed, I do believe! :slight_smile:

(Youā€™re making the rest of us look bad! :stuck_out_tongue:)

Well, after downloading 1.10.0 and fixing my obvious path errors, the main.py actually runs until ā€œcompiling shadersā€ ā€¦
ā€¦ and then spits out ā€¦

File "main.py", line 289, in onSceneLoaded
    self.scene.prepareScene(self.win.getGsg())
AttributeError: 'NoneType' object has no attribute 'prepareScene'

Hereā€™s a screenshot of the output of the command-line.
imgur.com/Ichu40N

Iā€™ll check the samples:
Simple works. Color banding looks horrible and thereā€™s quite the latency between pressing a key and the program reacting.

Roaming Ralph works and again the input-lag.

The colours of the carousel seem to be off. Sometimes the grass is green, sometimes itā€™s yellow, it seems to have three different shadows. imgur.com/Kt4I2gK

The fourth one looks wrong again. I get errors from ā€œLightManagerā€ in the output console.

What baffles me is how the lag between input and reaction does not match the rather fluid movement of the program once it reacts to the input. CommandLine output keeps telling me it finds more lamps than there are supported, which seems to be 1 only.

Hope this helped! Can provide you with more screenshots of debug output or whatever, if you want.
What I donā€™t understand is that you provide screenshots of examples, but these examples donā€™t exist anywhere.
Thatā€™s quite the downer. :stuck_out_tongue:

Most of the samples are not in the repo to keep the repo clean (since it would push the repo far over 1GB), however rdb hosted some of them, if you update to a recent version of the pipeline, it will print out the download link, so you can download it and then run the main file.

For the color banding, are you having an AMD card? It seems there are issues with color LUTS on amd cards. About the carousel, can you try updating to a more
recent pipeline version first? (Keep in mind, you will have to checkout the new master, and not the old master, since I created a new master to reduce the repository size)

About the input lag, hm, Iā€™m not sure what could cause this, looking at your screenshots you seem to have a relatively low frame rate tho, maybe you have
gpu-buffering enabled? (Are you on linux or windows?)

Edit:
Just saw youā€™re on windows, in that case, try disabling gpu buffering in your driver control panel (set the number of max pre-rendered frames to 1)

I thought Iā€™m using the most up2date versionā€¦ will check.

Iā€™m running a gtx765m with 2gb vram.

I will do as you said and report back with more screenshots, will probs take a bit again. :slight_smile:

Btwā€¦ does that mean changing driver settings is mandatory? Thatā€™s a bugger, because most people will never ever do that, or donā€™t know how to do so. Hm. Anyhow, will do!

Well, changing the driver settings certainly helps. For most bigger programs, the driver vendors already store the best values, so the user does not have to adjust anything. Iā€™m not sure if panda3d can take influence on those settings (especially buffering)

Hi Tobias,

I used to go by the name ā€œkurohyouā€ but I canā€™t seem to access that account anymore. I was developing an editor for Panda3d (github.com/Derfies/panda3d-editor) with plugin architecture. Iā€™ve recently become interesting in this project again and will start fixing some of the issues with it in order to let others contribute to it more easily. My question is, do you think your stuff could be integrated with an editor easily?

Hey, I saw you donā€™t use shaders (Is that correct?), in that case it will be very easy, just have a look at the simplest example: https://github.com/tobspr/RenderPipeline/blob/master/Samples/01-Simple/main.py. Basically you just have to init the pipeline and replace the Lights provided by panda (SpotLight, DirectionalLight) with the equivalents from the pipeline.

Iā€™m currrently refactoring the pipeline tho (including the api), so you might want to wait until Iā€™m done with that (shouldnā€™t take too long)

I think I just use the native Panda shaders that get created automatically. I assume that Iā€™ll have to turn that off in order to run your stuff?

Iā€™ll see if I can do a basic integration of your pipeline into the editor. I had some success getting your terrain into the editor as well :wink: Iā€™ve got plenty of bugs to fix in order to get plugins and wrappers to work properly so take your time. Will post if I get something cool happening.

I installed this great addition and it was easy to get it to work on my computer with the latest Panda version (Panda3D-SDK-1.10.0pre-9868d87-x64.exe) for windows 7 64 bit . When I run the examples, for example Tut-Roaming-Ralph, thereā€™s a constant flickering. When Ralph is standing still, thereā€™s a flickering of around 1 Hz, and when heā€™s walking the frequency is a couple of times per second. I tried different settings in configuration.prc and pipeline.ini, but I canā€™t get it away.
My test system:

  • Nvidia GTX770, 2 GB
  • OpenGL 4.4
  • driver version 355.60. WHQL (latest driver of Nvidia)

There are a number of warnings after I change a value in the Pipeline debugger : ā€œFragment shader is going to be recompiled because the shader key based on GL state mismatchesā€, but the flickering is not related to the frequency of the warnings.

There must be something I overlooked, any help would be appreciated.

Thanks

Hm, you can safely ignore the fragment shader warning. About the flickering, hm, would it be possible to try a different driver maybe? Some nvidia drivers tend to be buggier than others. What for a flickering is it exactly, is the screen getting black? Can you press ā€œVā€ and see if any buffer shows the flickering?

Its a flickering in which light and dark colours alternate rapidly. For example, the green grass becomes lighter green and then darker green, and then light green again, etc.

When I press V, a lot of buffers show the flickering, for example:

  • DeferredScenePass color
  • DeferredScenePass aux2
  • GlobalIlluminationPass
  • ShadowedLights
  • LightingPass
  • ExposePass
  • and all after that.
    DeferredScenepass color switches rapidly between pink and blue for the grass
    DeferredScenepass aux2 switches rapidly between full red and black/red

Can you go to Config/pipeline.ini and set enableEarlyZ to False there, and see if that helps? Also, do you have any custom configuration options, like threading or so enabled?

I havenā€™t changed any of the default values in pipeline.ini or configuration.prc. I also experimented with the driver settings (switch FXAA on/off, thread optimalisation automatic/off, etc) but that didnā€™t make a difference either.

I tried switching enableEarlyZ to False, but that doesnā€™t help. However, what I found was that is that the flickering disappears if I disable PBS and Shadows in the pipeline debugger. If one of these two is enabled again, the flickering reappears.

Thanks

I donā€™t know what it means, but if I toggle all features off (occulsion, scattering,etc) in the buffer viewer, DeferredScenePass color and DeferredScenePass aux2 still show the flickering, although it canā€™t be seen in the FinalPass. If I then enable PBS, the flickering also can be seen in FinalPass and all buffers before that.

Another thing is that, depending on where Ralph is standing, thereā€™s a flickering of 1 per second that matches with the start of ā€˜redrawingā€™ of DistributeVoxels.

Sorry for all the messages, but I think I now found it. When I set enableGlobalIllumination to False in pipeline.ini, the flickering is gone.

Hm, thats very strange, it seems more like a driver bug to me. Did you have the chance of trying an older driver?

Yes, I have tried 347.09 of Nvidia as well. I have now installed the latest driver of Nvidia, which is 355.60. Both show the same flickering. But I can live without the globalIllumination.

In my own databases I have a lot of transparent png textures. However, they are not drawn transparent, but as green rectangles even though I have set useTransparency = True in pipeline.ini. Is there another setting that may cause this ?

Yeah, Iā€™m sorry, I accidentally disabled it in the latest commit. You have to go to Shader/DefaultShaders/Default/fragment.glsl and uncomment line 41.

FYI, useTransparency doesnā€™t relate to binary transparency, it only controls non-opaque objects

If I uncomment line 41 the transparant part of the texture changes from green to black, but its still not transparant. In the egg file, the texture looks like this, for example:

21 {
ā€œtextures/facades/TreeLine02.pngā€
alpha { dual }
wrap { repeat }
wrapu { repeat }
wrapv { repeat }
minfilter { linear-mipmap-linear }
magfilter { linear }
envtype { modulate }
}

and this is drawn transparant in Panda. Do I need to make changes for trnasparant textures in the deferred pipeline ?