trnrez
17-02-2009 22:26:28
I want to set a world texture to my terrain and then use texture splatting on top of that texture. I have read through the forum and I haven't found anything telling me how to set the texture using terrain manager.
I am not very familiar with materials but I added the colormap example at the beginning that way I would set the world texture as the bottom layer. Then I simply made splatting0.png a 512x512 transparent texture. I figured that would draw correctly but it draws the texture as pure black so I have no idea.
I am very sorry if this question is extremely simply I have been browsing the forums for an answer for the past three hours and haven't came across a fix.
The ETTerrain.material:
Thanks for your time and any help or guidance is greatly appreciated.
Thanks,
Jonathan Jones
I am not very familiar with materials but I added the colormap example at the beginning that way I would set the world texture as the bottom layer. Then I simply made splatting0.png a 512x512 transparent texture. I figured that would draw correctly but it draws the texture as pure black so I have no idea.
I am very sorry if this question is extremely simply I have been browsing the forums for an answer for the past three hours and haven't came across a fix.
The ETTerrain.material:
material ETTerrainMaterial
{
technique
{
// Draw the world texture
pass
{
lighting off
// from the lightmap pass before to counter lod-bugs
vertex_program_ref ET/Programs/VSLodMorph2
{
}
fragment_program_ref ET/Programs/PSLighting
{
}
//
// other blend modes work too
scene_blend modulate
texture_unit
{
// your structure / color-map
texture ETterrain_texture.jpg
}
}
// primary splatting technique, requires PS 2.0
// has issues with OpenGL rendering, though...
pass
{
// splatting pass
lighting off
vertex_program_ref ET/Programs/VSLodMorph2
{
}
fragment_program_ref ET/Programs/PSSplat2
{
param_named splatScaleX float 20
param_named splatScaleZ float 20
}
texture_unit
{
// first coverage map, dynamically managed
texture ETSplatting0
}
texture_unit
{
// second coverage map, dynamically managed
texture ETSplatting1
}
// splatting textures
texture_unit
{
texture splatting0.png
}
texture_unit
{
texture splatting1.png
}
texture_unit
{
texture splatting2.png
}
texture_unit
{
texture splatting3.png
}
texture_unit
{
texture splatting4.png
}
texture_unit
{
texture splatting5.png
}
}
pass
{
// lightmap texture pass
scene_blend modulate
vertex_program_ref ET/Programs/VSLodMorph2
{
}
fragment_program_ref ET/Programs/PSLighting
{
}
texture_unit
{
// dynamically created
texture ETLightmap
}
}
}
technique
{
// fallback technique for ps 1.1
pass
{
// first splatting pass
lighting off
vertex_program_ref ET/Programs/VSLodMorph
{
param_named splatScaleX float 20
param_named splatScaleZ float 20
}
fragment_program_ref ET/Programs/PSSplat
{
}
texture_unit
{
// will be dynamically generated by the splatting manager
texture ETSplatting0
}
texture_unit
{
texture splatting0.png
}
texture_unit
{
texture splatting1.png
}
texture_unit
{
texture splatting2.png
}
}
pass
{
// second splatting pass
lighting off
scene_blend add
vertex_program_ref ET/Programs/VSLodMorph
{
param_named splatScaleX float 20
param_named splatScaleZ float 20
}
fragment_program_ref ET/Programs/PSSplat
{
}
texture_unit
{
// will be dynamically generated by the splatting manager
texture ETSplatting1
}
texture_unit
{
texture splatting3.png
}
texture_unit
{
texture splatting4.png
}
texture_unit
{
texture splatting5.png
}
}
pass
{
// lightmap texture pass
scene_blend modulate
vertex_program_ref ET/Programs/VSLodMorph
{
param_named splatScaleX float 20
param_named splatScaleZ float 20
param_named_auto morphFactor custom 77
}
fragment_program_ref ET/Programs/PSLighting
{
}
texture_unit
{
// dynamically created
texture ETLightmap
}
}
}
}
Thanks for your time and any help or guidance is greatly appreciated.
Thanks,
Jonathan Jones