Problem with PLSplattingShaderLit

asmo

27-02-2007 20:13:22

Hey, I have a problem with PLSplattingShaderLit.
Geforce 7900:
http://www.netherforce.com/images/felShader.jpg

I removed the second technique due to a material crash (or nullified the textuer_units in it).

On a side note, I'm using the decompress version.

nindim

27-02-2007 21:24:40

I'm using the non decompress PLSplattingShaderLit and it works ok, as discussed before the ambient is a little off but it's still pretty good. I never had any luck with the decompress one, terrain wouldnt even show up, in that respect you're doing better than me ;)

asmo

27-02-2007 22:14:02

I'm using the non decompress PLSplattingShaderLit and it works ok, as discussed before the ambient is a little off but it's still pretty good. I never had any luck with the decompress one, terrain wouldnt even show up, in that respect you're doing better than me ;)

Not sure I'm doing better, same thing happens to me while using the normal one. PaintCenter crashes if I keep the second technique (thinks it has 3 materials where the last material is null, or corrupted).

nindim

27-02-2007 23:23:35

Ley me know how you get on anyway, painting is something I never was able to get working for some reason.

nindim

28-02-2007 01:08:44

I've now got painting working with plsplattingshaderlit if its of any use to you?

asmo

28-02-2007 09:56:34

Hey,

I got it to work now (painting, shadows, correct ambient..). I changed the ambient pass in PLSShaderDecompressedLit til the SplattingShadersCompressed one. Works a treat (:

Now my second problem is how to be able to use more then 4 textures.

nindim

28-02-2007 11:34:40

Could you post the exact changes you made and to which files, or better yet the entire files please? I don't know a lot about shaders and even looking at the code of the plsplatting shaders gives me a headache! The ambient problem has been annoying me now for quite a while. Would be extrememly grateful if you could help me out.

I understand the decompress versions of the textureformats enable compressed textures to be used, but what format must they be compressed to? Also Can only compressed textures be used or will it also run with normal textures? Maybe this is why my terrain doesnt show up using the decompress version?

Oh and what type of shadows do you have working, I could only get the texture modulative ones working with ther non decompress version...

nindim

28-02-2007 17:46:28

I tried taking this code from material SplattingShaderDecompress:


vertex_program_ref DecompressSplatShadercg/VP
{
param_named_auto worldViewProj worldviewproj_matrix
//param_named_auto lightDirection light_direction_object_space 0
//param_named_auto ambientLight ambient_light_colour

// x scale
// y scale
// z scale
// Morph Factor
param_named compressionSettings float4 90000.0 1.37331 90000.0 0.0
/// 90000 / 65535

// Fog settings are;
// start
// end
// scale (e.g. 0.0 to switch off)
//param_named fogSettings float4 500.0 1000.0 1.0 0.0
// Fog colour
//param_named fogColour float4 0.93, 0.86, 0.76 1.0
}

shadow_receiver_vertex_program_ref DecompressVertexShadowReceiver/VP
{
param_named_auto worldViewProj worldviewproj_matrix
param_named_auto worldMatrix world_matrix
param_named_auto texViewProjMatrix texture_viewproj_matrix

// Config settings are;
// x scale
// y (height) start
// z scale
//
param_named compressionSettings float4 90000.0 1.37331 90000.0 50000.0
}

fragment_program_ref DecompressSplatShadercg/FP
{
//param_named_auto lightDirection light_direction_object_space 0
//param_named_auto ambientLight ambient_light_colour
}

texture_unit
{
// coverage texture : rgba handling alpha for each splat
texture Coverage
}

texture_unit
{
texture Splatting
}

texture_unit
{
texture Splatting
}

texture_unit
{
texture Splatting
}

texture_unit
{
texture Splatting
}


and replacing the ambient pass in material PLSplattingShaderLitDecompress with it. Still looks the same. All I get is my skydome and my meshes and some huge flcikering white rectangle things on the screen where i assume the terrain should be.

My mesh decal is still hugging the terrain and i can make out certain features, it just isnt showing up the actual terrain at all. Any ideas?

asmo

28-02-2007 20:32:04

I have not worked everything out yet it seems:
PLShaderDecompressLit:
http://www.netherforce.com/images/PLShader.png
Normal Splatting material:
http://www.netherforce.com/images/SplattingMaterial.png

The texture coordinates wont scale well, not sure if this is due to the shader or PLSM.

nindim

28-02-2007 21:35:57

Where are you changing the scale factor? It has to be changed from within the shader itself as it doesnt currently pass them through as far as i know. Theres a variable in the shader named splatscales i think that I just hard coded to whatever i wanted and it scaled beautifully.

asmo

28-02-2007 22:09:12

Where are you changing the scale factor? It has to be changed from within the shader itself as it doesnt currently pass them through as far as i know. Theres a variable in the shader named splatscales i think that I just hard coded to whatever i wanted and it scaled beautifully.

Yha, just found out (: Ty

nindim

01-03-2007 00:31:41

Glad you found it.

Any chance you could enlighten me with regards to all this decompress stuff? Doesnt seem to be mush info about it anywhere on the wiki or forums. As far as i know it allows decompression of compressed textures, but beyond that I don't know anything.

I "fixed" the plsplattingshaderlit texture factor by using falagard's spur of the moment fix he posted for ambient in response to patrickb3 i believe, I also had to add splatting (minus the coverage map) to the ambient pass in order for it to look right. The ambient can be set through the app at normal values so the meshes look right, the shading on the terrain is also no longer black with no texture detail. overall it looks much more believable, especially for a daytime scene.

I tried your method of simply copying splattingshader stuff but from what I could see that would leave you with an unlit terrain....?

asmo

01-03-2007 10:48:38

VertexCompression : If your card supports it, enable it (if you card doesn't suport it will be ignored). It divides GPU Memory usage by at least factor 3. (Default Value : no)

- Wiki (:

nindim

01-03-2007 18:30:15

Hmmm, I though from this line by tuan located here:
http://www.ogre3d.org/phpBB2addons/viewtopic.php?t=1452&highlight=decompress


If you want to enable compression on a material, add "Decompress" keyword at the end of the name.


Reading back on it maybe it is talking about vertex compression, I thought that could be done on any tetxure mode though, nothing to state otherwise that I've seen, at leats in wiki.

It still doesnt explain why all I get is white liney rectangles appearing sporadically when moving camera. STrange. I'm using an ATI card, maybe problems with that?

shermannx

17-03-2007 00:27:42

Hi!

I'm just starting to use PLSM2 and having a lot of trouble trying to achieve what I have in mind. By the way I think PLSM2 really rocks!!!!!!!!!!!!

I'd like to use a height map and alpha maps generated from L3DT, and create a terrain that I can dynamically light and cast shadows on.

After reading the Wikis, FAQ, config file settings etc etc what I can make out is that I need to use the PLSplattingShaderLit format and a coverage map containing an alpha map that contains the ones from L3DT and converted into a coverage map where all the RGBA values for each pixel add up to 100% (or 255).

Now, I have a height map that's been generated and split using L3DT, and a sort of coverage map but where the RGBA values are currently set to a texture number, rather than colour value. I have 4 texture maps in hand also.

As far as I can tell I just need to convert these alpha maps into a coverage map that PLSM2 expects (.PNG format, one layer, RGBA adding up to 100%).

I am stuck on how to generate this coverage map. I also suspect that the 512x512 pages that L3DT produces may be incorrect and that they have to be 513x513.

Could anyone tell me how to can create the coverage map and if my height map is split properly? Oh also, do I need a normals map?

Thanks!!

Dibalo

23-03-2007 17:44:28

Sorry for getting this old topic to the top.

I got it to work now (painting, shadows, correct ambient..). I changed the ambient pass in PLSShaderDecompressedLit til the SplattingShadersCompressed one. Works a treat (:
I would be very interested in getting the modified shader files too.. I´d need shadows, but I can´t use the current PLSplattingShaderLit because it´s ambient light is not working at all. So, I you could send the modified files, I´d be very thankful (and many other too, I think..). :)