1.6.1 Cell Shading Demo

Done, and I still see nothing.

        
    self.accept("a", self.aa)
    
    def aa(self):
        if self.aon:
            self.aon = False
            render.clearAntialias()
            render2d.clearAntialias()
        else:
            self.aon = True
            render.setAntialias(AntialiasAttrib.MAuto)
            render2d.setAntialias(AntialiasAttrib.MLine)

I’m using that in order to turn on and off aa, and when I zoom in, and check nothing changes. I have the

loadPrcFileData("", "framebuffer-multisample #t")
loadPrcFileData("", "multisamples 1")

At the top of the file before DirectStart.

I have the following graphics card

ATI Radeon X1600:

  Chipset Model:	ATY,RadeonX1600
  Type:	Display
  Bus:	PCIe
  PCIe Lane Width:	x16
  VRAM (Total):	256 MB
  Vendor:	ATI (0x1002)
  Device ID:	0x71c5
  Revision ID:	0x0000
  ROM Revision:	113-xxxxxx-158
  EFI Driver Version:	01.00.158
  Displays:

which should be enough to do AA effects (I think), I only bring this up since I’m on a laptop and you never know.

After the window has opened, call this:

print base.win.getFbProperties().getMultisamples()

to tell how much multisamples your card gave you.

So it gives me two, that should at least show some change right?

Yes, though the change may be very subtle. Look closely at aliased edges and see if you can find at least some smoothing.

I’m using a pixle peeper and the AA toggle and there is nothing.

I don’t have a better machine to try this on, otherwise I would do that…

on my machine
aa on

aa off

I can package up the code for this and post it somewhere, but I already feel like I’m sucking up time on something that should be obvious.

What platform are you on, what display are you using (pandagl, tinydisplay, pandadx9 or pandadx8), does switching between them make any difference?

Also, to be certain, specify MMultisample instead of MAuto in the setAntialias call.

Just checked MMultisample and I still see nothing.

I’m on a Mac, so I’m using pandagl and I can’t use tinydisplay because the shaders don’t work.

Hmm. It could be that there’s a bug on OSX with multisample antialiasing.
I believe drwr already fixed this bug some time ago (before 1.6.0 even), according to this thread.

Could some other OSX user perhaps confirm if MSAA is working?

I’ll check for that tomorrow night. I also still need to check if maya2egg is working; not had time yet.

btw what does this mean?

It means the bug where the cartoon outlines are not matching the model and the glow sample only shows the legs was my fault - caused by a tiny typo. I’ve already fixed it on CVS.

ah ok. So it’s fixed on CVS but not the build on the download page right? Not that it matters much either way, just want to keep it all straight in my mind.

So, I tried running this under VM ware, unfortunately it only does multisample of 1, which is (I think) useless for this test.

If anybody could run the cartoon shader with AA on and tell me if they get better results between the two runs (especially on the mac) that would be amazingly cool.

Thank You

Does AA work without cartoon inking?

Ok, so, I just looked at Roaming Ralph and set things up with him to use AA, When I turn on and off AA it doesn’t do anything for changing.

When I turn on and off

loadPrcFileData("", “framebuffer-multisample #t”)

loadPrcFileData("", “multisamples 1”)

I then get a much softer ralph.

though the same thing does not happen with the cartoon inking.

You’re right, there’s a semi-bug there.
The problem is that the FilterManager renders the scene into a buffer texture. This has no multisamples by default. However, my card doesn’t support buffers with multisamples (or at least the buffer creation code returns None), so it simply won’t work in that case.

Does this work, after creating the filter?

self.filters.finalQuad.setAntialias(AntialiasAttrib.MMultisample)

So, that didn’t fix it, but I’m using the advanced cartoon shading which doesn’t have the filters. But even on the other one the filters thing didn’t fix it.

Sorry, I don’t think I should write when I’m that tired.

I’m using the advanced cartoon shaders, so there is not a self.filters object. I tried it on the basic cartoon shaders test app and it also did not fix it.

I also had a windows user try to run this and he did not see the AA effect. So my guess is that I somehow need to AA the output of the shaders at each step? But when I try to do the following on what I think is the output of the inkShader it doesn’t help.

drawnScene.setAntialias(AntialiasAttrib.MMultisample)

Sorry this took so long, and it sounds like this is no longer information you need to know, but for reference the following code does show antialiasing on OSX:

#antialiasing instructions from
#https://discourse.panda3d.org/viewtopic.php?t=1559
#also try fsaa 3/4 of the way down

from pandac.PandaModules import loadPrcFileData 
loadPrcFileData("", "framebuffer-multisample 1")

import direct.directbase.DirectStart

from pandac.PandaModules import AntialiasAttrib
render.setAntialias(AntialiasAttrib.MMultisample, 1) 

#Load the first environment model
environ = loader.loadModel("models/environment")
environ.reparentTo(render)
environ.setScale(0.25,0.25,0.25)
environ.setPos(-8,42,0)

#Run the tutorial
run()

So that’s using MMultisample no MAuto.

jhocking, is there any way you could test the cartoon animation with the same thing?

Also, when I do the same thing on my computer I see nothing, at least no difference between the AA version and the non AA version…

Highly frustrating.