Menu

[da613a]: / docs / sceneTest.glscene  Maximize  Restore  History

Download this file

114 lines (102 with data), 2.9 kB

//Delimiters:
//<>: Resource and node names. These will be converted to IdStrings.
//"": Filenames, or string names that are construed as filenames.
//'': Strings that will be stored and used in the graph.
//[]: GLSL identifier.
//{}: "Enumerators". Things that a specific parameter takes, which are selected from a specific list.
//(): lists of numbers, for things like vectors.

resources
	texture_res <ship_diffuse_tex> "diffuse_ship.dds"
	texture_res <ship_reflect_tex> placeholder
	sampler_res <trilinear-clamp>
		mag[linear]
		min[linear-mip-linear]
	end
	sampler_res <aniso-repeat>
		compare[less]
		mag[linear]
		min[linear-mip-linear]
		aniso 8
		wrap_s[repeat]
		wrap_t[repeat]
		wrap_r[repeat]
	end
	mesh_res <ship_mesh> [octahedron] //Generate from enumerator.
	program_res <shader>
		vert "transform.vert"
		frag "diffuse_reflect.frag"
		mtc {modelToCamera}
		nmtc {normalModelToCamera}
		sampler {diffuse_tex} 0
		uniform_buffer {projection_matrix} 0
		uniform_buffer {lights} 2
	end
	program_res <shader>
		vert "transform.vert"
		frag "diffuse_reflect.frag"
		mtc {modelToCamera}
		nmtc {normalModelToCamera}
		sampler {diffuse_tex} 0
		sampler {reflect_tex} 4
		uniform_buffer {projection_matrix} 0
		uniform_buffer {lights} 2
	end
	program_res <sep_shader> [separable]
		frag "frag_shader.frag"
		sampler {diffuse_tex} 0
		uniform_buffer {projection_matrix} 0
	end
	uniform_buffer_res <projection_matrix> 64 [stream-draw]
	uniform_buffer_res <lights> 128 placeholder
	uniform_res <num_lights> {lights.numLights} [float] 5
	uniform_res <test_value> {test} [vec3] (2.43 3.4 9.8)
	camera_res <main> [left-btn] [left-kbd]
		target ()
		orient (quat)
		spin init
		radius init minimum maximum
		radius_delta small large
		pos_delta small large
		rotation_scale scale
	end
end

scene
	//Defines all layers
	layer_defs 'main' 'shadow1' 'shadow2' 'alt'
	
	//List of all legal style names.
	style_check <test>

	node <globals>
		//Layer for the current node.
		//Children will inherit 'main' and 'alt', but not 'shadow1'.
		layers 'shadow1' +'main' +'alt'

		local <matrices>
			uniform_buffer 0 <projection_matrix>
			uniform_buffer 2 <lights>
		end
		
		node <ship>
			//Adds 'shadow1' layer.
			//Removes the inherited 'main' and 'alt' layers.
			//Children will still inherit 'main', but they will *not* inherit 'alt'.
			//That is, they inherit the *lack* of alt.
			layers 'shadow1' -'main' +-'alt'
			
			node_tm
				orientation (0 0.707 0 0.707)
				translate (0 5 0)
			end
			object_tm
				scale (2)
			end
			
			local <common>
				mesh <ship_mesh> 'variantName'
				texture 0 <ship_diffuse_tex> <aniso-repeat>
			end

			style <test>
				using <matrices> <common>

				program <reflect_shader>
					uniform <num_lights>
				end

				texture 4 <ship_reflect_tex> <trilinear-clamp>
			end

		end
	end
end
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.