Nitlanguage.org
  • Nitdoc
  • gamnit
  • depth
  • shadow
  • LightPointOfViewProgram
  • defaultinit

init defaultinit

gamnit :: LightPointOfViewProgram :: defaultinit

  • Doc
  • Linearization

Summary

  • Property definitions

  • gamnit::shadow$LightPointOfViewProgram$defaultinit

Property definitions

gamnit $ LightPointOfViewProgram :: defaultinit
# Draw the camera point of view on screen
private class LightPointOfViewProgram
	super GamnitProgramFromSource

	redef var vertex_shader_source = """
		// Vertex coordinates
		attribute vec3 coord;

		// Vertex coordinates on textures
		attribute vec2 tex_coord;

		// Output to the fragment shader
		varying vec2 v_coord;

		void main()
		{
			gl_Position = vec4(coord, 1.0);
			v_coord = tex_coord;
		}
		""" @ glsl_vertex_shader

	redef var fragment_shader_source = """
		precision mediump float;

		// Virtual screen texture / color attachment
		uniform sampler2D texture0;

		// Input from the vertex shader
		varying vec2 v_coord;

		void main()
		{
			gl_FragColor = texture2D(texture0, v_coord);
		}
		""" @ glsl_fragment_shader

	# Vertices coordinates
	var coord = attributes["coord"].as(AttributeVec3) is lazy

	# Coordinates on the textures, per vertex
	var tex_coord = attributes["tex_coord"].as(AttributeVec2) is lazy

	# Visible texture
	var texture = uniforms["texture0"].as(UniformSampler2D) is lazy
end
lib/gamnit/depth/shadow.nit:428,1--472,3
Nit standard library. Version .