scene: add noodle
This commit is contained in:
parent
e5148ac4b8
commit
5f867891fa
@ -23,7 +23,7 @@ collada_scene = {
|
|||||||
-- index buffer
|
-- index buffer
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
|
|
||||||
local index_data = love.filesystem.newFileData("scene/test/test.idx")
|
local index_data = love.filesystem.newFileData("scene/noodle/noodle.idx")
|
||||||
index_buffer = love.graphics.newBuffer("uint32", index_data, { index = true, usage = "static" })
|
index_buffer = love.graphics.newBuffer("uint32", index_data, { index = true, usage = "static" })
|
||||||
|
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
@ -35,7 +35,7 @@ collada_scene = {
|
|||||||
{ name = 'Normal', format = 'floatvec4' },
|
{ name = 'Normal', format = 'floatvec4' },
|
||||||
{ name = 'Texture', format = 'floatvec4' },
|
{ name = 'Texture', format = 'floatvec4' },
|
||||||
}
|
}
|
||||||
local vertex_data = love.filesystem.newFileData("scene/test/test.vtx")
|
local vertex_data = love.filesystem.newFileData("scene/noodle/noodle.vtx")
|
||||||
local shaderstorage_buffer = love.graphics.newBuffer(format, vertex_data, { shaderstorage = true, usage = "static" })
|
local shaderstorage_buffer = love.graphics.newBuffer(format, vertex_data, { shaderstorage = true, usage = "static" })
|
||||||
shader:send("VertexLayout", shaderstorage_buffer)
|
shader:send("VertexLayout", shaderstorage_buffer)
|
||||||
end,
|
end,
|
||||||
|
|||||||
16
main.lua
16
main.lua
@ -7,20 +7,22 @@ local mat4 = _math.mat4
|
|||||||
local vec3 = _math.vec3
|
local vec3 = _math.vec3
|
||||||
local vec4 = _math.vec4
|
local vec4 = _math.vec4
|
||||||
local scalar = _math.scalar
|
local scalar = _math.scalar
|
||||||
local scene_test = require 'scene.test.test'
|
|
||||||
local collada_scene = require 'collada_scene'
|
local collada_scene = require 'collada_scene'
|
||||||
local collada_scene_animate = require 'collada_scene.animate'
|
local collada_scene_animate = require 'collada_scene.animate'
|
||||||
local collada_scene_node_state = require 'collada_scene.node_state'
|
local collada_scene_node_state = require 'collada_scene.node_state'
|
||||||
|
|
||||||
|
local scene_test = require 'scene.test.test'
|
||||||
|
local scene_noodle = require 'scene.noodle.noodle'
|
||||||
|
|
||||||
local node_state
|
local node_state
|
||||||
|
|
||||||
function love.load(args)
|
function love.load(args)
|
||||||
love.window.setMode(1024, 1024, {depth=true})
|
love.window.setMode(1024, 1024, {depth=true})
|
||||||
|
|
||||||
collada_scene.load_buffers()
|
collada_scene.load_buffers()
|
||||||
collada_scene.load_images("scene/test", scene_test.descriptor.images)
|
collada_scene.load_images("scene/noodle", scene_noodle.descriptor.images)
|
||||||
|
|
||||||
node_state = collada_scene_node_state(scene_test.descriptor.nodes)
|
node_state = collada_scene_node_state(scene_noodle.descriptor.nodes)
|
||||||
end
|
end
|
||||||
|
|
||||||
local rotation = 0.0
|
local rotation = 0.0
|
||||||
@ -33,13 +35,13 @@ function love.draw()
|
|||||||
width, height = love.graphics.getDimensions()
|
width, height = love.graphics.getDimensions()
|
||||||
|
|
||||||
local aspect_ratio = width / height
|
local aspect_ratio = width / height
|
||||||
local projection = mat4.perspective_fov_rh(scalar.convert_to_radians(45 / 2),
|
local projection = mat4.perspective_fov_rh(scalar.convert_to_radians(45),
|
||||||
aspect_ratio,
|
aspect_ratio,
|
||||||
0.1,
|
0.1,
|
||||||
1000.0)
|
1000.0)
|
||||||
|
|
||||||
local view = mat4.look_at_rh(vec3(-88.57101, -71.71298, 104.5738),
|
local view = mat4.look_at_rh(vec3(-54.43401, -35.53392, 57.3912),
|
||||||
vec3(-19.90239, -27.72767, 54.6898),
|
vec3(0.0, 0.0, 13.41141),
|
||||||
vec3(0, 0, 1))
|
vec3(0, 0, 1))
|
||||||
|
|
||||||
local world1 = mat4.rotation_x(rotation)
|
local world1 = mat4.rotation_x(rotation)
|
||||||
@ -48,7 +50,7 @@ function love.draw()
|
|||||||
|
|
||||||
local transform = view * projection
|
local transform = view * projection
|
||||||
|
|
||||||
collada_scene_animate.update(t, node_state)
|
--collada_scene_animate.update(t, node_state)
|
||||||
t = t + 0.016
|
t = t + 0.016
|
||||||
|
|
||||||
love.graphics.setDepthMode("less", true)
|
love.graphics.setDepthMode("less", true)
|
||||||
|
|||||||
BIN
scene/noodle/images/0_logOnly.png
Normal file
BIN
scene/noodle/images/0_logOnly.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
1747
scene/noodle/noodle.DAE
Normal file
1747
scene/noodle/noodle.DAE
Normal file
File diff suppressed because one or more lines are too long
BIN
scene/noodle/noodle.idx
Normal file
BIN
scene/noodle/noodle.idx
Normal file
Binary file not shown.
2312
scene/noodle/noodle.lua
Normal file
2312
scene/noodle/noodle.lua
Normal file
File diff suppressed because it is too large
Load Diff
6
scene/noodle/noodle.mk
Normal file
6
scene/noodle/noodle.mk
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
IMAGES += image/0_logOnly.DDS
|
||||||
|
image/0_logOnly.DDS: ./images/0_logOnly.png
|
||||||
|
@mkdir -p image
|
||||||
|
texconv10.exe -f BC1_UNORM -nologo "$<"
|
||||||
|
mv "$(<:.png=.DDS)" "$@"
|
||||||
|
|
||||||
5
scene/noodle/noodle.rc
Normal file
5
scene/noodle/noodle.rc
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
RES_SCENES_NOODLE_VTX RCDATA "noodle.vtx"
|
||||||
|
RES_SCENES_NOODLE_VJW RCDATA "noodle.vjw"
|
||||||
|
RES_SCENES_NOODLE_IDX RCDATA "noodle.idx"
|
||||||
|
|
||||||
|
_0_LOGONLY_PNG RCDATA "image/0_logOnly.DDS"
|
||||||
0
scene/noodle/noodle.vjw
Normal file
0
scene/noodle/noodle.vjw
Normal file
BIN
scene/noodle/noodle.vtx
Normal file
BIN
scene/noodle/noodle.vtx
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user