Worklog for nawi
3d lib
Return to Worklogs| 
 | ||
| Development is going slowly, because of school stuff.. I managed to add
 fog (which took like a minute), but there's a shot anyway (I like 
screenshots:). By the way, the code for the library looks like this: Strict
Import "ngl.bmx"
Local Gfx:NGraphics = NGraphics.Start(800,600)
Local Cam:NCamera = NCamera.CreateCamera()
Cam.Move(30,10,-60)
Cam.SetClearColor(163,192,255)
Cam.EnableFog(30,100,163,192,255)
HideMouse
Local Cube:NEntity = NEntity.CreateCube()
Cube.LoadTexture("crate.jpg")
Cube.EntityAlpha 0.3
Local Mesh:NEntity = NEntity.LoadMesh("md2/fish.md2")
Mesh.ScaleMesh(0.3,0.3,0.3)
Local Light:NLight = NLight.CreateLight()
Light.Translate(20,40,0)
Light.Ambient(255,255,255)
Light.Diffuse(255,255,255)
Local Map:NEntity = NEntity.Heightmap("hmap.bmp")
Map.LoadTexture("grass.png")
Repeat
	'Camera control
	If KeyDown(KEY_LEFT) Then Cam.Move(-0.3,0,0)
	If KeyDown(KEY_RIGHT) Then Cam.Move(0.3,0,0)
	If KeyDown(KEY_UP) Then Cam.Move(0,0,0.3)
	If KeyDown(KEY_DOWN) Then Cam.Move(0,0,-0.3)
    
        Mesh.Animate()
 
        Gfx.Render
	Gfx.Swap(1)
Until KeyHit(KEY_ESCAPE)
--- Home Taping is Killing Music - StuntMoto -Free software for free people - Patent Absurdity - "1984, you've read the book, now live it!" | 
| 
 | ||
| The particle engine is pretty much done. Switched to point sprite 
opengl extension, which is pretty fast. Z-sorting more than halves the 
fps though :/. This is required for alpha particles. --- Home Taping is Killing Music - StuntMoto -Free software for free people - Patent Absurdity - "1984, you've read the book, now live it!" | 
| 
 | ||
| Added support for parent/child, added CreateSprite (which just creates a
 quad which consists of 2 triangles), and finally heightmap loading. 
This just loads the heightmap, and the result is a normal entity/mesh.. --- Home Taping is Killing Music - StuntMoto -Free software for free people - Patent Absurdity - "1984, you've read the book, now live it!" | 
| 
 | ||
| Added support for GLSL shaders. It was pretty simple, but the real 
difficulty is creating new shaders.. but that is left for the users :). Here's a basic toon shader: and another one: --- Home Taping is Killing Music - StuntMoto -Free software for free people - Patent Absurdity - "1984, you've read the book, now live it!" | 
| 
 | ||
| Today I've mostly been watching The League of Gentlemen, so I didn't 
get much done. I added FreeEntity,FreeTexture and AddMesh methods, and 
optimized list creating.. now the list is only created just before 
rendering if necessary, instead of every mesh operation, except for 
copyentity. This way copying an entity uses the old mesh until it is 
modified. --- Home Taping is Killing Music - StuntMoto -Free software for free people - Patent Absurdity - "1984, you've read the book, now live it!" | 
| 
 | ||
| I've been working on an OpenGL 3D library, I've got the basic stuff of 
entities, cameras, movement etc working, and MD2 loading with 
animations. I also have texture loading working. I still need to work on
 the particle system.. Lights are pretty much done too. Today I've mostly doing optimizing, and it is starting to be performing decently. Statistics: 1000 MD2 entities, with textures and alpha translucency, 1000 triangles each totaling 1 million triangles, and I get ~47fps at 800x600 resolution. With 100 entities, I'll get 280fps. This is with 8400M laptop gfx card. Random shots: --- Home Taping is Killing Music - StuntMoto -Free software for free people - Patent Absurdity - "1984, you've read the book, now live it!" |