Cell shading and antialiasing problem (1st part solved)

Hello every one,
I’m not English, sorry for the mistakes I’m maybe gonna make :unamused:

I’m new to Panda, I have Blender 2.6a with YABEE, and Python 3.3.
To begin, I took the basic cube in Blender, applied the “magic” texture from blender, so in the “render” (F12), I see my cube with this texture.

When exporting, all’s right, I load my cube, it works, but there are no textures on it !!!

I added a light, but my cube is grey, as the basic blender cube without any changes !!!
Moreover, when I load some .png textures, it only loads the main colour of the picture… (I don’t have beautiful textures, just all brown, or green, but never 2 different colours).

What do I’ve got to do ?
Should I load the texture (called Texture.001 in Blender) inside my .egg file ?
In that case, I don’t know the command to do it…

Should I resize the textures before ?
Even so, it didn’t work…

I need your help, thank you !!! (yeah, I know, I’m some kinda newbie :frowning: )

Otherwise, I did apply some cell-shading on my cube, which WORKS …
But the black lines of the cell shading do not have any anti-aliasing, whereas my cube has if I remove the
cell shading: the anti-aliasing is turned on, but is hidden by the black lines :confused:

How to apply some anti-aliasing on these black lines (fir information, I used Multisample x8, which is totally supported by my GPU)

Thank you again to answer :smiley:
Note that I only use Panda and learn Python for 4 weeks, and use them for a school game project :wink:

Regarding your textured cube, have you UV-mapped your cube? (If I recall correctly, doing this in Blender involves entering “edit mode”, then pressing “u” and selecting the UV-mapping method that you desire. You may want to look at the “UV/Image editor” view in order to see the resultant UV-map.)

Further, note that a texture applied in Blender may only work if it’s applied as a texture map (although I may be mistaken in this); you may want to “bake” a procedural texture such as the “magic” effect, although I fear that I forget how Blender does this.

Finally, depending on how you’re applying your texture, you may find YABEE’s “UV as texture” option useful.

Thank you very much… However, I’m not very good at using Blender :frowning:
I don’t know what UV is, nor how to use it, nor texture map is, and I didn’t find YABEE’s “UV as texture”…I’ll watch tutorials :wink:
Thank you anyway :smiley: !!!

Now, about anti-aliasing and cell shading… can somebody help me ?

How did you specify antialiasing?

I wrote that for the cell shading :

    light = render.attachNewNode("light")
    render.setShaderInput("light", light)
    normalsBuffer=base.win.makeTextureBuffer("normalsBuffer", 0, 0) 
    normalsCamera=base.makeCamera(normalsBuffer, lens=base.cam.node().getLens())
    tempnode = NodePath(PandaNode("temp node"))
    self.drawnScene = drawnScene
    self.separation = 0.001 #default = 0.001 
    self.cutoff = 0.25 #default = 0.3
    inkGen = loader.loadShader("inkGen.sha")
    drawnScene.setShaderInput("separation", Vec4(self.separation,0,self.separation,0));
    drawnScene.setShaderInput("cutoff", Vec4(self.cutoff,self.cutoff,self.cutoff,self.cutoff));

And that for the antialiasing :


If you specify multisample antialiasing like that, you also need to specify “framebuffer-multisample #t” in Config.prc, plus “multisamples 8” (or a different number of samples).

Yes I did…
But the antialiasing works well: the fact of adding cell shading adds black lines (which I want), that hide the cube’s edges with antialiasing…
Although the antialiasing works, I’d like it to be applied to the black lines of cell shading :slight_smile:
Do you have any suggestions to make the cell shading lines be “anti-aliased” ?

1st part solved !
I just had to play with UV mapping, to create a 2d texture (.png) and to load it !
Now I have a cube with 6 textured faces !
However, I don’t know how I’m gonna do with 3d textures… I’ll see ! :slight_smile:
Thank you very muuuuch !!!

Only the part with antialiasing and cell shading remains :wink: