Terrain decals with shaders

Hi everybody !



Do you know where I can find a tutorial about creating terrain decals with Shaders ?



By the way, where can I find a good tutorial on Shaders and Cg Shaders ?



I know nothing on shaders but it seems to be a way to put decals !



Thanks  :wink:

many ways todo this job.


  1. good looking big textures
  2. tiles for texturing
  3. combinition of both (possible with shaders)



    search our JME Forum for "tile" or "tilemapping"  :smiley:



    good luck


BlackBluegL said:

good luck


Thanks  :D

I am trying to understand shaders by myself and I have several questions :

  • It seems that GLSL shaders dont' work well on my computer. Can I do the exactly same things with ARB shaders in jME?

  • I want to use textures with ARB shaders but I can only pass float arguments. Is it possible to use textures in ARB shader. The LWJGLVertexProgramState doesn't show this kind of function. Should I modify it ?



Thanks

Look at the Test-Classes in jme-souce.

You can find an bumpmapping-example that uses vp/fp.

Too bad the files are not Cg files  :stuck_out_tongue:



It seems necessary to learn the assembly syntax to use shaders !



Sorry for my noob questions ans thank you for your help  :wink:

or buy a "new"(though a few years old would suffice) gfx card that can handle glsl.

yes MrCoder



and the Orange-book for the OpenGL Shading Language



}:-@

:’(

OK, ok, you're both right !  :stuck_out_tongue:



But let me answer :

  • I thought my GeForce card was not so bad (and not so old !) but it seems that it can't handle GLSL fragment shaders  (and not vertex shaders, don't ask me why) :expressionless:
  • I did read the GLSL cookbook which is, by the way, far better than Cg cookbook !



    I WANT to use GLSL shaders but I also want make a game which can be used on most computers. When I see my model, "Dawn of war", which seems to use ARB shaders, goes ok on my computer …

you can develop shaders using nvidia CG and then compile to your favorite. (ARB for example)

That's what I want to do …



The compilation works well and I can use the generated scripts but it makes me return to my first question :


Joseph Beaufils said:

I want to use textures with ARB shaders but I can only pass float arguments. Is it possible to use textures in ARB shader. The LWJGLVertexProgramState doesn't show this kind of function. Should I modify it ?

OK, i understand…



do the following:


  1. create a TextureState
  2. create the Texture-Objects you want to use
  3. set the created Texture-Objects on TextureState
  4. set the created TextureState on your Spatial
  5. create your VertexProgramState- and FragmentProgramState-objects
  6. set the created VP and FP-states on your Spatial



    look at SceneElement.setRenderState(…)  for information


  7. attach to the Scene and ready.



    :smiley: hope this helps




Thank you  XD

I will try it as soon as possible !