Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /.../
- model = assetManager.get("mesh/Sting-Sword-lowpoly.obj", Model::class.java)
- texture = assetManager.get("badlogic.jpg", Texture::class.java)
- val m = ModelInstance(model)
- val mat = Material()
- mat.set(TextureAttribute.createDiffuse(texture))
- m.materials[0] = mat
- /.../
- attribute vec3 a_position;
- attribute vec3 a_normal;
- attribute vec2 a_texCoord0;
- uniform mat4 u_projViewWorldTrans;
- uniform sampler2D u_diffuseTexture;
- varying vec3 v_normal;
- varying vec2 v_texCoord;
- void main()
- {
- v_texCoord = a_texCoord0;
- v_normal = normalize(a_normal);
- gl_Position = u_projViewWorldTrans * vec4(a_position, 1.0);
- }
- uniform sampler2D u_diffuseTexture;
- varying vec2 v_texCoord;
- void main()
- {
- //Get color
- vec4 color = texture(u_diffuseTexture, v_texCoord);
- gl_FragColor = color;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement