autoshader:undefined variable "tot_diffuse" (w/ light ramps)

Np. Trying to use Panda3D in a hobby project, and happened to get this error. :slight_smile:

Ah, true! Good point on backward compatibility.

I won’t promise anything, but if my free time allows, I might be interested in experimenting with adding this. At least specular quantization would be useful as an option.

About ambient quantization, on second thought I’m less sure, and will really have to test. Currently the ambient light level is a nice tuning parameter for adjusting the cartoon look. If it was quantized, it might actually become less useful. But maybe as a separate option.

I also have some other ideas for the cartoon shader that I’d like to try:

  • Short gradients between the shades for an antialiased look. Currently, the edges between light and shadow look very sharp because of the strict quantization. A simple solution to make the edges smoother would be to exploit the fact that the original lighting values are usually continuous. Hence, if we add a linear interpolation (in brightness space) transitioning the light level over the threshold value(s), the edges between light and dark should become less pixellated, while retaining the overall quantized look. This should be easy to implement (but if the length of the gradient needs to be customizable, then I need to learn a bit about how to add new parameters to the LightRampAttrib API).

  • Tut-Cartoon-Advanced has a cutoff parameter that would be nice to have in the CommonFilters version. This should only require integrating the custom cutoff code from the sample program into the existing CommonFilters infra, so it shouldn’t be too hard (and should be a good chance to learn).

  • The cartoon ink filter could be improved to take into account the distance from the camera when drawing the edges, in order to keep the perceived line thickness (approximately) constant. This would be especially useful in settings where the camera distance changes dynamically. The first idea that comes to mind is to use z-buffer data to affect the separation value. It seems the “depth” texture (used by the ssao filter) already contains this data.

Ok. I will try this.

Ok… and done.

Not exactly new to this game, but setting up a dev tree always takes a few hours :stuck_out_tongue:

Running “python makepanda/makepanda.py --everything --verbose” gave a pretty good idea what to install, and the manual:
panda3d.org/manual/index.ph … cense_info
helped with identifying the more exotic ones. Installing and using apt-file (as you suggested at Compiling on Kubuntu 12.04 ) to find the correct packages was also a good idea.

Just in case anyone else wants to set up a Panda3D dev tree in Ubuntu 12.04 (Precise Pangolin), at least the following packages are needed:

libeigen3-dev libavformat-dev libavcodec-dev libavutil-dev libswscale-dev libfreetype6-dev libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libosmesa6-dev libode-dev libopenal-dev libopencv-dev libcv-dev libhighgui-dev libtiff4-dev libgtk2.0-dev libjpeg-dev libpng-dev libxrandr-dev libxxf86dga-dev libxcursor-dev bison flex libboost-python-dev

And since it’s not in the repos, get libRocket from here (thanks to JörnS!):

As for Bullet, as was explained by enn0x here:

the version of Bullet needs to be 2.80. The newer 2.81 won’t do, because the interface has changed. Bullet 2.80 has not been packaged for precise (12.04), but it seems possible to use the packages for quantal (12.10), available here:
ubuntuupdates.org/package/co … bullet2.80
ubuntuupdates.org/package/co … bullet-dev
Just download and sudo dpkg -i these two.

After installing all that, “python makepanda/makepanda.py --everything --nofftw --verbose --installer” should complete without errors. (There was a problem linking pview when fftw was enabled, and since I don’t really need this library, I just chose to disable it.)

I installed the generated .deb (first uninstalling the downloaded official one) and at least the sample programs in /usr/share/panda3d run fine.

On a final side note, it seems that the automatic dependency checking in makepanda in 1.8.1 won’t catch if libcv-dev (cxcore.h) and libhighgui-dev (highgui.h) are missing; installing just libopencv-dev makes the dependency check pass, but the compile will fail midway unless also libcv-dev and libhighgui-dev are installed. Maybe cxcore.h and highgui.h should be added to the dependency checker (unless already there in the latest source)?

Now, to find some more time to do some coding :slight_smile: