anchor.diff:  = JME3 and Shaders
  -:author:
  -:revnumber:
  -:revdate: 2016/03/17 20:48
  -:relfileprefix: ../../
  -:imagesdir: ../..
  -ifdef::env-github,env-browser[:outfilesuffix: .adoc]
  +:revnumber: 2.0
  +:revdate: 2020/07/22
   
   
   
  
positive.code: 
  To understand the coming example you must know about the different spaces in 3D computer graphics, and the matrices used to translate coordinate from one space to another.
  
  image:jme3/advanced/jme3andshaders-1.png[jme3andshaders-1.png,width="",height="", align="left"]
  
  The engine passes the object space coordinates to the vertex shader. We need to compute its position in projection space. To do that we transform the object space position by the WorldViewProjectionMatrix, which is a combination of the World, View, Projection matrices (who would have guessed?).
  
  
negative.code: 
  This is a very simplified graphic to describe the call stack:
  
  image:shader/jme3andshaders.png[jme3andshaders.png,width="",height="", align="left]
  
  The main program sends mesh data to the vertex shader (vertex position in object space, normals, tangents, etc..). The vertex shader computes the screen position of the vertex and sends it to the Fragment shader. The fragment shader computes the color, and the result is displayed on screen or in a texture.
  
  