splatting without using height as a factor

aclysma

13-03-2008 20:15:21

I want to be able to just blend textures on some very simple (almost flat) terrain. However, the only splatting I've been able to do with the demo program and playing with config files has been based on height. Even if I directly modify the coverage maps, my own custom blending doesn't show up - rather the texture blending weights are strictly defined by the height of the terrain.

What I *want* is to be able to modify by hand a texture that defines the proportion of all textures to blend with. What settings do I need to have to do this?

Also, some other questions for my curiosity:
- What is the difference between a coverage map and an alpha map
- Why is the alpes example coverage maps multicolored and mine are just varying shades of blue (By "my" terrain I'm actually referring to the "hf" terrain which I duplicated and am making slight changes to)

Thanks
Philip

Maxi

13-03-2008 22:33:22


What I *want* is to be able to modify by hand a texture that defines the proportion of all textures to blend with. What settings do I need to have to do this?


Use one of the splatting texture modes; texture blending is then based on the coverage or alpha map which can be painted with the setOption() function of the scene manager.


- What is the difference between a coverage map and an alpha map


Found here

aclysma

14-03-2008 21:29:36

Another random question - is it possible to render the terrain so that it spreads across x and y and faces the positive Z direction?

Still working on texture splatting stuff.. though I do have my application building and using plsm rather than relying on the binary demo that is posted. :)

aclysma

14-03-2008 22:16:11

I figured out splatting - from what I understand whether its the alpha maps or the coverage map that effects the terrain depends on what type of splatting is being used. I'm doing SplattingShader so alpha maps are ignored and I need to use the coverage map instead.

aclysma

14-03-2008 23:44:17

So, I've gotten what I want to happen working in the prebuilt binary demo of PLSM2. I've also built my own dll of the plugin against my local copy of ogre. I'm able to create the scene manager and am able to debug it. In short, I think the code portion is installed correctly.

I am having problems though seeing any of the terrain. If I take my cfg files from the binary demo and try to open them, different things happen depending on the texturing mode I select:

splatting and splatting2 run but don't show anything
splattingshader (the one I want to use) crashes with this error in the log:

18:41:04: OGRE EXCEPTION(2:InvalidParametersException): Named constants have not been initialised, perhaps a compile error. in GpuProgramParameters::_findNamedConstantDefinition at e:\projects\ogrecvs\branches\eihort_vc8_clean\ogrenew\ogremain\src\ogregpuprogram.cpp (line 873)

when trying to run this line:

params->setNamedAutoConstant("compressionSettings",
GpuProgramParameters::ACT_CUSTOM, MORPH_CUSTOM_PARAM_ID);

I have a feeling that a resource is missing, but I have the textures, scripts, and programs directories from PLSM2 on my resource path.

Any ideas?

aclysma

15-03-2008 18:30:59

I figured out why the terrain wasn't showing up - I somewhere along the way changed the name of the resource group in my .cfg file so it basically wasn't finding the files. Instead of throwing an exception, PLSM simply logs the error and continues. I will remember to check the logs next time something like this happens!

This still leaves open the following two questions:
- Can I rotate the entire terrain to match my coordinate system
- Still having the error mentioned above regarding the function call to setNamedAutoConstant("compressionSettings")

Thanks

aclysma

16-03-2008 02:41:48

Looking at the code and seeing X and Z used as variable names, as well as the way scene nodes are used within the plsm2 plugin has convinced me that there is no simple way to rotate the world 90 degrees about the X axis to use X and Y as the axis.

The error above still persists but I figured out how to use Splatting (as opposed to SplattingShader) and it is meeting my needs. I am getting an error when I use it though but only sometimes (it seems to be random). The error happens when ogre closes - in DirectX when the buffers are swapped, I get an "Invalid window handle."

I can probably hack around this somehow but I'd rather not, and I don't think either of these (the problem on quitting my application or the setNamedAutoConstant problem in the previous post) are within my area of knowledge to be able to fix correctly.

Any suggestions?