Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. /.../
  2. model = assetManager.get("mesh/Sting-Sword-lowpoly.obj", Model::class.java)
  3. texture = assetManager.get("badlogic.jpg", Texture::class.java)
  4.  
  5. val m = ModelInstance(model)
  6.  
  7. val mat = Material()
  8. mat.set(TextureAttribute.createDiffuse(texture))
  9. m.materials[0] = mat
  10.  
  11. /.../
  12.  
  13. attribute vec3 a_position;
  14. attribute vec3 a_normal;
  15. attribute vec2 a_texCoord0;
  16.  
  17. uniform mat4 u_projViewWorldTrans;
  18. uniform sampler2D u_diffuseTexture;
  19.  
  20. varying vec3 v_normal;
  21. varying vec2 v_texCoord;
  22.  
  23. void main()
  24. {
  25. v_texCoord = a_texCoord0;
  26. v_normal = normalize(a_normal);
  27. gl_Position = u_projViewWorldTrans * vec4(a_position, 1.0);
  28. }
  29.  
  30. uniform sampler2D u_diffuseTexture;
  31. varying vec2 v_texCoord;
  32.  
  33. void main()
  34. {
  35. //Get color
  36. vec4 color = texture(u_diffuseTexture, v_texCoord);
  37.  
  38. gl_FragColor = color;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement