yeah, the normal example works just fine, except that i get this lovely little exception when i try to use TerrainLighting.j3md
If i touch the .setTexture and change it from “Alpha” to “m_AlphaMap” as i see in some attempts in the forum, stuff just breaks(throws exception) the next texture over.
I don’t know where to even look for the answer.
Code:
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.IllegalArgumentException: Material parameter is not defined: Alpha
at com.jme3.material.Material.checkSetParam(Material.java:374)
at com.jme3.material.Material.setTextureParam(Material.java:476)
at com.jme3.material.Material.setTexture(Material.java:524)
at jme3test.helloworld.HelloTerrain.simpleInitApp(HelloTerrain.java:35)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:230)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:129)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:205)
at java.lang.Thread.run(Thread.java:680)
[edit]
Thanks for that link; where/how did you find it ?
[edit2]
Argh, now my terrain is invisible :S (i'm not falling though, and raycasting confirms that the terrain is still there)
@oxplay2 said:
...
AlphaMap_1
AlphaMap_2
AlphaMap_3
.....
AlphaMap_n
don't know how many possible
Just the 3 alpha maps right now, meaning a max of 12 diffuse textures. I plan to increase this in the future using texture arrays or 3d textures, I have to play around a bit first though and see how they work.
@oxplay yeah, i wanted it to be pitch-black first, so i could be sure everything was working, and see the exact result my lightsource was having but the sky fooled me into thinking the terrain had gone invisible. (because the sky is colored and not influenced by lighting)
as for the link: like i said, i must have glossed over that thinking it was about the terrain editor, as the link on the page says TerraMonkey, my sleep deprived brain thought it was about using the terrain editor.
@Sploreg said:
Just the 3 alpha maps right now, meaning a max of 12 diffuse textures. I plan to increase this in the future using texture arrays or 3d textures, I have to play around a bit first though and see how they work.
Actually I'm already mid finished with this based on the TerrainLightning, and can contribute as soon as everything works correctly.
@ xeno
Usually there are tutorials in the wiki.
However for the lighening:
you need x diffuse maps and x normal maps(normal maps are optional, but look quite awesome)
now set the diffuse maps (take a look at the j3md file for exact names, note hat you never do the m_ from jme (it is more for the shaders, that the names between attributes from the mesh and materialparameters cannot overlap).
Alphamap defines where wich of the diffuse maps is. for a tst I suggest using 3 diffuse maps and one alpha atthe beginning. RGB of a pixel in the alphamap then decides what texture to use for the corresponding geometry part. Now the last thing, add for example a Pointlight to the scene.
Then it should work.
hehe, i’ll have to do a little study as to what half of that means (as you migth have notices, i’m a bit of a n00b in this , i normally do buisiness logic CMS/webapps in php )
@EmpirePhoenix said:
Actually I'm already mid finished with this based on the TerrainLightning, and can contribute as soon as everything works correctly.
If you want to contribute it I would love to incorporate it into core :)
But the extreme dark is what i wanted :) it sure does prove lighting works. I had the orbiting red ball from some of the example code in before, but i noticed no difference on the terrain. Now; i'll see differences :)
now you should really add some ambient light(just a little), DepthOfFieldFilter to blur distant terrain, and Light Scattering. Thats all will give full effect