terrain with texture splatting

I have made a terrain in blender with 2 textures and stencil.
Can i get that to Panda without shaders?
PS. Does panda have terrain paging?

save out all your textures as images, make sure you UV-mapped everything correctly, and export it. it should work just fine. at least the last time i tested it it worked fine.
for paging.well if you use blender-made geometry paging is just a matter of loading and unloading single parts of your terrain. you can easily implement that yourself.
if you intend to use panda’s geomipterrain , i think someone worked on paging, dunno the status.

  1. It does? Ill try. Im sure i asked this for another engine and they said you need a shader. Ql.
  2. Is heightfield faster than 3d geometry?
  1. well yeah panda can handle a limited number of textures without shaders. usualy thats 4. so with just 2 textures + stencil you’r using 3. no problem so far. with shaders you can use a lot more.
    2.depends. in the end both are the same. 3d geometry. the heighfield is generated during runtime and includes an LOD system. so usualy you can display a greater distance. but it also has some drawbacks especially if you want to use blender, cause there is no real way to preview the highfield model in blender. so objet placement is a bit tricky. using highfields you cant use caves and overhangs either.

so depending on your needs you have to choose wisely

For some reason when i load 3 textures in Blender for 1 model, stencil in the middle, it shows up correctly in Blender, but in pview, only the 3rd texture and the white part of the stencil appear. I even tried black and transparency instead of black and white, but its the same.

did you save the stencil texture into an image and did you tell blender to actually use that image?

Yeah and yeah

mhm. thatn its strange. it definetly works for me. can you provide a simple blend file which demonstrates your problem?
if necessary. i can make another blender2panda tutorial about using stencil textures.

My terrain system:
discourse.panda3d.org/viewtopic.php?t=7304

It supports masked detail textures, and paging of terrain tiles. It is in the pretty early stages of development though, and uses shaders. Currently its only setup to work with procedural height maps, though it could work with a premed one. Eventually it will be much more useful with an editor and such, but not yet.

^ Well that is interesting but it has some errors like frame skips. Still interesting I would like to see it improve.
@Thomas, I pm’d you the file.

hm… dunno where’s the problem. i went into the uv-editor, saved all 3 textures to disk. then used chicken to export it. worked perfectly fine.

Which versions of Chicken are you two using? I ask because between R74 and R75 that code was completely rewritten in prep for Panda 1.7.0, except that hasn’t been released yet. Put simply, with the current version of Panda you have to either use R74 for stencil support, or use a cvs build of panda with a more recent version. I know its not ideal, but then it was done with the expectation that 1.7.0 would be released months and months ago.

Another warning - lighting is handled differently between the fixed pipeline and the shader system - its correct with shaders, but with the fixed pipeline only the first layer of the terrain is properly lit, which can look… weird. (This is with all Panda versions - you can fix it by tweaking the .egg file, but in doing so you break the ability of the file to work with the shader generator, which I see as the more important route these days as even old laptops have shaders now.)

r71b on my end

R81 and that was the problem.
But the old one doesnt have pzip option, so are you thinking of fixing that bug?
and

more info?
Oh and you cant tile the terrain textures (scale them to be bigger than the image in the UV Window) in Blender like this, can you? Because then the stencil will be tiled as well, because they use the same UV…

Its not a bug so much as a version mis-match - the whole problem will go away when 1.7.0 is finally released!

To fix it in the .egg file is kinda complicated, and involves changing the various texture stage modes and adding one. Unless you have done any openGL programming this is likely to be confusing, at best. In the shader pipeline the image starts as white (Unless there are vertex colours.) and then the texture stages are applied one after another until it reaches the end, at which point lighting is applied. It is under this set of assumptions that Chicken writes out its texture stages into the .egg file. The fixed function pipeline however applies lighting first, via the vertices. In the fixed function pipeline what happens is that ‘before’ texture is the lighting, which then is multiplied with the first texture you have applied in the first texture stage, which is then blended using your stencil texture with the second texture stage, which is unlit, hence the problem. There are two potential solutions to this - either add lighting to the second texture before its mixed in or remove lighting from the first texture and multiply it in after both textures have been mixed.

That is the general idea - I’ve never done it so I’m not being very specific - I could work it out but am on a lunch break at work right now and don’t have an example file to play with. But you will need to edit the texture sections of your egg file, the syntax of which can be found here: http://panda3d.cvs.sourceforge.net/checkout/panda3d/panda/src/doc/eggSyntax.txt You will also have to add a texture stage regardless, and will need to fiddle with the combine-alpha-source0 etc. stuff. Its quite complicated and would need to be scripted - you couldn’t reliably make such a change to an egg file by hand as it involves adding in a new texture stage for every polygon.

I’ld love to be able to fix this in some sense, but I just don’t have the time right now I’m afraid, and have a bunch of other stuff to do first for Chicken, not to mention I need to start worrying about Blender 2.50

Edit: Chicken supports multiple uv maps btw, which will fix your tiling issue.

Sorry…

Cool…
For the rest I dont think I understood everything, but I get the idea. I dont know shader programming, so no lights for me then.

Well thats cool, looks like bult-in toon shading doesnt support stencils.
So how about a feature request?

You don’t need shader programming - the autoshader system will generate a suitable shader for you, from a single function call - look it up in the manual!

As for the toon thing, I don’t know that system so can’t say what would be involved - someone else will have to get back to you on that. I wouldn’t hold out much hope though, as I would guess that currently works using the fixed function pipeline (Its been around a while.), and so getting in stencil support would be hard if not impossible.

The built-in toon shading uses the programmable pipeline. In fact, it requires the programmable pipeline to pass in the screen-space normal vectors in an additional render target.

Before 1.7.0, the shader generator kinda sucked at combine modes though. I bet that is the problem here.

lethe, are you telling me to take a look at Shader Generator for the light problem or the stenciling problem? Because if the stenciling with toon shading cant be fixed then the light problem is the last thing i would think of fixing.