linking assets also into *-core, *-ios, is very useful!!!

Any community contributions to libgdx go here! Some may get included in the core API when permission is granted.

linking assets also into *-core, *-ios, is very useful!!!

Postby jaishnavgomes » Sat Jul 13, 2019 11:46 am

I wanted to learn computer graphics techniques, starting with shadow mapping. I tried to implement it based on some articles on the Internet, but it goes really wrong. I am really struggling. Can someone help me with the code? (or otherwise, if you have an implementation of Shadow Maps in Libgdx, I would like to see that).

Here are the two shaders for the depth map : Mobdro

attribute vec3 a_position;
attribute vec3 a_normal;
attribute vec2 a_texCoord0;

uniform mat4 u_worldTrans;
uniform mat4 u_projViewTrans; //Light Camera

varying vec4 v_positionLightFrame;

void main() {
v_positionLightFrame = u_projViewTrans * u_worldTrans * vec4(a_position, 1.0);
gl_Position = v_positionLightFrame;

#ifdef GL_ES
precision mediump float;

varying vec4 v_positionLightFrame;
uniform float cameraFar;

void main()
gl_FragColor = vec4(v_positionLightFrame.z/cameraFar, v_positionLightFrame.z/cameraFar, v_positionLightFrame.z/cameraFar, 1.0);
Posts: 2
Joined: Sat Jul 13, 2019 11:29 am

Return to Libgdx Contributions

Who is online

Users browsing this forum: No registered users and 1 guest