mirror of
https://github.com/bloeys/nmage.git
synced 2025-12-29 13:28:20 +00:00
Textures + basic asset loading system+ uvs
This commit is contained in:
10
main.go
10
main.go
@ -23,7 +23,6 @@ import (
|
||||
//Flesh out the material system
|
||||
//Object
|
||||
//Abstract UI
|
||||
//Textures
|
||||
//Audio
|
||||
|
||||
//Low Priority:
|
||||
@ -82,11 +81,16 @@ func main() {
|
||||
imguiMat = materials.NewMaterial("ImGUI Mat", "./res/shaders/imgui")
|
||||
|
||||
//Load meshes
|
||||
cubeMesh, err = meshes.NewMesh("Cube", "./res/models/color-cube.fbx", asig.PostProcess(0))
|
||||
cubeMesh, err = meshes.NewMesh("Cube", "./res/models/tex-cube.fbx", asig.PostProcess(0))
|
||||
if err != nil {
|
||||
logging.ErrLog.Fatalln("Failed to load cube mesh. Err: ", err)
|
||||
}
|
||||
|
||||
//Set mesh textures on material
|
||||
for _, v := range cubeMesh.TextureIDs {
|
||||
simpleMat.AddTextureID(v)
|
||||
}
|
||||
|
||||
initImGUI()
|
||||
|
||||
//Enable vertex attributes
|
||||
@ -352,7 +356,7 @@ func draw() {
|
||||
cubeMesh.Buf.Bind()
|
||||
tempModelMat := modelMat.Clone()
|
||||
|
||||
rowSize := 10
|
||||
rowSize := 100
|
||||
for y := 0; y < rowSize; y++ {
|
||||
for x := 0; x < rowSize; x++ {
|
||||
simpleMat.SetUnifMat4("modelMat", &tempModelMat.Translate(gglm.NewVec3(-1, 0, 0)).Mat4)
|
||||
|
||||
Reference in New Issue
Block a user