textures; distribution script
|
@ -0,0 +1,5 @@
|
||||||
|
cd src
|
||||||
|
zip -9 -r "../ᐊᑯᓕᕕᒃ.love" .
|
||||||
|
cd ..
|
||||||
|
#windows
|
||||||
|
cat "/home/frc/Bureau/frc/dev/love/love-11.5-win64/love.exe" "ᐊᑯᓕᕕᒃ.love" > ᐊᑯᓕᕕᒃ.exe
|
|
@ -0,0 +1,3 @@
|
||||||
|
Assets:
|
||||||
|
Johann Wilhelm Weis-Cuiller, photo par Ji-Elle sur Wikipedia: https://commons.wikimedia.org/wiki/File:Johann_Wilhelm_Weis-Cuiller.jpg licenced under CC-BY-SA 4.0: https://creativecommons.org/licenses/by-sa/4.0/
|
||||||
|
Coffee spoon MET 17847.jpg, CC0 https://commons.wikimedia.org/wiki/File:Coffee_spoon_MET_17847.jpg
|
|
@ -1,8 +1,7 @@
|
||||||
local lg = assert( love.graphics )
|
local lg = assert( love.graphics )
|
||||||
local mesh = lg.newMesh(
|
local mesh = lg.newMesh(
|
||||||
{--attributes
|
{--attributes
|
||||||
{"VertexPosition", "float", 3},
|
{"VertexPosition", "float", 2},
|
||||||
{"VertexColor", "float", 3},
|
|
||||||
{"VertexTexCoord", "float", 2},
|
{"VertexTexCoord", "float", 2},
|
||||||
},
|
},
|
||||||
{--vertices
|
{--vertices
|
|
@ -38,6 +38,7 @@ function t.draw( view, proj )
|
||||||
love.graphics.setCanvas( canvas )
|
love.graphics.setCanvas( canvas )
|
||||||
love.graphics.clear()
|
love.graphics.clear()
|
||||||
love.graphics.setDepthMode( "less", true )
|
love.graphics.setDepthMode( "less", true )
|
||||||
|
love.graphics.replaceTransform( tf )
|
||||||
|
|
||||||
for name, shader in pairs( shaders ) do
|
for name, shader in pairs( shaders ) do
|
||||||
love.graphics.setShader( shader )
|
love.graphics.setShader( shader )
|
||||||
|
@ -46,16 +47,17 @@ function t.draw( view, proj )
|
||||||
|
|
||||||
for mesh in pairs( drawLists[ name ] ) do
|
for mesh in pairs( drawLists[ name ] ) do
|
||||||
local modelMatrix = meshes[ mesh ]
|
local modelMatrix = meshes[ mesh ]
|
||||||
tf:setMatrix( "column", modelMatrix )
|
shader:send( "mdl", "column", modelMatrix )
|
||||||
love.graphics.draw( mesh )
|
love.graphics.draw( mesh )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
love.graphics.pop()
|
||||||
love.graphics.setCanvas()
|
love.graphics.setCanvas()
|
||||||
love.graphics.setDepthMode( "always", false )
|
love.graphics.setDepthMode( "always", false )
|
||||||
love.graphics.setShader()
|
love.graphics.setShader()
|
||||||
|
love.graphics.origin()
|
||||||
love.graphics.draw( canvas[1] )
|
love.graphics.draw( canvas[1] )
|
||||||
love.graphics.pop()
|
|
||||||
|
|
||||||
if isDebugging then
|
if isDebugging then
|
||||||
isDebugging = false
|
isDebugging = false
|
|
@ -16,10 +16,6 @@ function t.play()
|
||||||
player:setTurnRate( settings.mouseSensitivity.val )
|
player:setTurnRate( settings.mouseSensitivity.val )
|
||||||
player:setFOV( settings.FOV.val )
|
player:setFOV( settings.FOV.val )
|
||||||
renderer.start()
|
renderer.start()
|
||||||
--[[ local terrain = require( "models/terrain" )
|
|
||||||
terrain:setTexture( rockTexture )
|
|
||||||
renderer.add( terrain )
|
|
||||||
renderer.update( terrain, {{1, 0, 0, 0}, {0,1,0,0},{0,0,1,0},{0,0,-3,1}})]]
|
|
||||||
|
|
||||||
local plane = require( "models/plane" )
|
local plane = require( "models/plane" )
|
||||||
plane:setTexture( rockTexture )
|
plane:setTexture( rockTexture )
|
||||||
|
@ -89,6 +85,9 @@ function t.keypressed( key, code, isrepeat )
|
||||||
if code == settings.keyUse.val then
|
if code == settings.keyUse.val then
|
||||||
|
|
||||||
end
|
end
|
||||||
|
if code == "q" then
|
||||||
|
renderer.debug()
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function t.keyreleased( key, code )
|
function t.keyreleased( key, code )
|
|
@ -114,16 +114,16 @@ function t.update( dt )
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function t.draw()
|
do
|
||||||
|
|
||||||
love.graphics.setScissor( 0, 0, 400, love.graphics.getHeight() )
|
|
||||||
|
|
||||||
if not terrain:getTexture() then
|
|
||||||
local tex = love.graphics.newImage( "tex/terrain.png" )
|
local tex = love.graphics.newImage( "tex/terrain.png" )
|
||||||
tex:setFilter( "nearest", "nearest" )
|
tex:setFilter( "nearest", "nearest" )
|
||||||
tex:setWrap( "repeat", "repeat" )
|
tex:setWrap( "repeat", "repeat" )
|
||||||
terrain:setTexture( tex )
|
terrain:setTexture( tex )
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function t.draw()
|
||||||
|
|
||||||
|
love.graphics.setScissor( 0, 0, 400, love.graphics.getHeight() )
|
||||||
|
|
||||||
love.graphics.draw( terrain, 0, 0, 0, 400, love.graphics.getHeight() )
|
love.graphics.draw( terrain, 0, 0, 0, 400, love.graphics.getHeight() )
|
||||||
|
|
|
@ -4,9 +4,10 @@ return love.graphics.newShader[[
|
||||||
varying float depth;
|
varying float depth;
|
||||||
varying float height;
|
varying float height;
|
||||||
#ifdef VERTEX
|
#ifdef VERTEX
|
||||||
|
uniform mat4 mdl;
|
||||||
uniform mat4 view;
|
uniform mat4 view;
|
||||||
uniform mat4 proj;
|
uniform mat4 proj;
|
||||||
vec4 position( mat4 mdl, vec4 pos ){
|
vec4 position( mat4 _, vec4 pos ){
|
||||||
vec4 world = mdl * pos;
|
vec4 world = mdl * pos;
|
||||||
height = world.y;
|
height = world.y;
|
||||||
vec4 eye = view * world;
|
vec4 eye = view * world;
|
After Width: | Height: | Size: 2.3 MiB |
After Width: | Height: | Size: 5.5 MiB |
After Width: | Height: | Size: 1.9 MiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 371 KiB After Width: | Height: | Size: 371 KiB |
Before Width: | Height: | Size: 2.8 MiB After Width: | Height: | Size: 2.8 MiB |