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 mesh = lg.newMesh(
|
||||
{--attributes
|
||||
{"VertexPosition", "float", 3},
|
||||
{"VertexColor", "float", 3},
|
||||
{"VertexPosition", "float", 2},
|
||||
{"VertexTexCoord", "float", 2},
|
||||
},
|
||||
{--vertices
|
|
@ -38,6 +38,7 @@ function t.draw( view, proj )
|
|||
love.graphics.setCanvas( canvas )
|
||||
love.graphics.clear()
|
||||
love.graphics.setDepthMode( "less", true )
|
||||
love.graphics.replaceTransform( tf )
|
||||
|
||||
for name, shader in pairs( shaders ) do
|
||||
love.graphics.setShader( shader )
|
||||
|
@ -46,16 +47,17 @@ function t.draw( view, proj )
|
|||
|
||||
for mesh in pairs( drawLists[ name ] ) do
|
||||
local modelMatrix = meshes[ mesh ]
|
||||
tf:setMatrix( "column", modelMatrix )
|
||||
shader:send( "mdl", "column", modelMatrix )
|
||||
love.graphics.draw( mesh )
|
||||
end
|
||||
end
|
||||
|
||||
love.graphics.pop()
|
||||
love.graphics.setCanvas()
|
||||
love.graphics.setDepthMode( "always", false )
|
||||
love.graphics.setShader()
|
||||
love.graphics.origin()
|
||||
love.graphics.draw( canvas[1] )
|
||||
love.graphics.pop()
|
||||
|
||||
if isDebugging then
|
||||
isDebugging = false
|
|
@ -16,10 +16,6 @@ function t.play()
|
|||
player:setTurnRate( settings.mouseSensitivity.val )
|
||||
player:setFOV( settings.FOV.val )
|
||||
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" )
|
||||
plane:setTexture( rockTexture )
|
||||
|
@ -89,6 +85,9 @@ function t.keypressed( key, code, isrepeat )
|
|||
if code == settings.keyUse.val then
|
||||
|
||||
end
|
||||
if code == "q" then
|
||||
renderer.debug()
|
||||
end
|
||||
end
|
||||
|
||||
function t.keyreleased( key, code )
|
|
@ -24,7 +24,7 @@ local function restoreCachedSetting()
|
|||
if settings[currentSetting].set then
|
||||
settings[currentSetting]:set(cachedSettingVal)
|
||||
else
|
||||
settings[currentSetting].val = cachedSettingVal
|
||||
settings[currentSetting].val = cachedSettingVal
|
||||
end
|
||||
cachedSettingVal = nil
|
||||
end
|
||||
|
@ -114,17 +114,17 @@ function t.update( dt )
|
|||
end
|
||||
end
|
||||
|
||||
do
|
||||
local tex = love.graphics.newImage( "tex/terrain.png" )
|
||||
tex:setFilter( "nearest", "nearest" )
|
||||
tex:setWrap( "repeat", "repeat" )
|
||||
terrain:setTexture( tex )
|
||||
end
|
||||
|
||||
function t.draw()
|
||||
|
||||
love.graphics.setScissor( 0, 0, 400, love.graphics.getHeight() )
|
||||
|
||||
if not terrain:getTexture() then
|
||||
local tex = love.graphics.newImage( "tex/terrain.png" )
|
||||
tex:setFilter( "nearest", "nearest" )
|
||||
tex:setWrap( "repeat", "repeat" )
|
||||
terrain:setTexture( tex )
|
||||
end
|
||||
|
||||
love.graphics.draw( terrain, 0, 0, 0, 400, love.graphics.getHeight() )
|
||||
|
||||
love.graphics.setScissor( 400, 0, love.graphics.getWidth() - 400, love.graphics.getHeight() )
|
|
@ -4,9 +4,10 @@ return love.graphics.newShader[[
|
|||
varying float depth;
|
||||
varying float height;
|
||||
#ifdef VERTEX
|
||||
uniform mat4 mdl;
|
||||
uniform mat4 view;
|
||||
uniform mat4 proj;
|
||||
vec4 position( mat4 mdl, vec4 pos ){
|
||||
vec4 position( mat4 _, vec4 pos ){
|
||||
vec4 world = mdl * pos;
|
||||
height = world.y;
|
||||
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 |