terrain with texture splatting

Well, stencil support has been through a lot of changes - appeared back sometime around R74 and has been through many iterations since - its just impossible to get something that works well in all situations. Don’t think there is another exporter to try however, and I know for a fact that the output of Chicken makes perfect sense and should work.

I agree that the stencil version does not get lit, though I’m sure I saw it working at some point. I don’t think its Chickens fault though, so my guess would be Panda. Unfortunately there is no way I know of getting the shader generators actual code, which would allow me to have a closer look.

I didn’t really mean a blender exporter.

Should I post this as a bug?

I think there is a way to dump the shader generated by the shaderGenerator. Is that what you mean?

Well, stencilling is quite an esoteric feature - I imagine the other exporter option will be the Maya one, and i don’t have that kind of cash floating around!

I am sure this is bug, but if someone could tell me how to get the shader generators code then I can have a closer look before we get that far - its quite possible I can change Chicken to work around whatever the issue is, as there are many, many ways of creating an egg file that has stencil support.

Hehe, me too, I just ment if someone has it I would greatly appreciate it if they tried it with Maya exporter and told me if it is properly lit in Panda (if the exporter does support stencils, of course).

That would be nice, this link should help you: discourse.panda3d.org/viewtopic … highlight=

Ugh, what a stupid way of extracting the shaders. Anyway, had a look and it looks like someone has ‘fixed’ it. Previously the shader generator did the texturing and then applied the lighting, now it does the lighting and then does the textures. This is actually correct - its how Open GL does it in the fixed pipeline, but Chicken assumes its doing it the old, incorrect way. Problem is that due to Pandas limited texture stage referencing inside egg’s (current, previous and one saved result is all you have.) I don’t see how you can now do stencil support with lighting, at least not cleanly. Now, what I can do is use the alpha channel to communicate the stencil map, and leave the saved result with the lighting data in it, then apply a final texture stage to multiply in the lighting. This will work, but it will involve me completely re-factoring the stencil system in Chicken, again. Maybe in a couple weeks I can do this, but right now I don’t have the time. Sorry - this feature really is a total pain, not helped by the fact people keep changing the parts of Panda it depends on. Second time its been broken by changed Panda behaviour!

So I’ll need to use shaders for 2 texture layered terrain with lightning?

Or maybe I should downgrade Panda…

Actually, that change would allow it to work with the fixed function pipeline, though with two texture layers you would be using 4 texture stages.

Not sure about downgrading Panda - I’ve got this sneaking suspicion that the current code is actually dependent on a specific cvs version that appeared between 1.6 and 1.7.

I ment 2 textures and 1 stencil…
But I don’t have any Cg knowledge, though.

Oh…

Should I try setting the textures with code like here? :
discourse.panda3d.org/viewtopic.php?t=8906
Or will this not work with lights either?

Yeah, I was referring to two textures plus a stencil - those are three of the texture stages. The forth would then be the stage to add lighting back in.

You wouldn’t need cg to do this though - you could just edit the egg file or, as you suggest, do it in code. What you do need to understand is texture stages - a reading of the texturing section of the Panda manual should be enough.

I would prefer to edit the .egg file rather than adding more lines of code for the terrain. But that will probably be a lot of editing for all the terrain chunks, so I’ll just go with adding more code.