Jump to content

Amon

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by Amon

  1. Is there a parameter I may have changed or is there something else I need to do with the lights? I'm basically getting a strong red tint to objects on the screen. I am using LoadMesh and loading a .gmf and assigning a material to it. I have 5 materials mat1, mat2, mat3 etc and each object is a clone of one mesh to which I apply the different material. My material setup is as follows, below: texture0="abstract::zombie0.dds" clamp0=0,0,0 blend=0 depthmask=1 depthtest=1 overlay=1 zsort=1 cullface=1 castshadows=1 specular=0.500000000 bumpscale=1.00000000 gloss=0.500000000 shader="abstract::mesh_diffuse.vert","abstract::mesh_diffuse.frag" shadowshader="abstract::mesh_shadow_skin.vert"
  2. Greetings, again! I would like to create lots of instances of my mesh but also randomize the material applied to the mesh. Code posted below, if anyone can point me to the right direction I would appreciate it, thanks. Secondly, TEntity? If I Load a mesh using either of the Load commands i.e. LoadMeshGMF, LoadMesh etc, am I right in thinking they inherit from TEntity automatically? If not then how would I go about using LoadMeshGMF or LoadMesh and create its TEntity? Thanks! SuperStrict Framework leadwerks.ENGINE Local world:TWorld Local gbuffer:TBuffer Local camera:TCamera Local Light:TLight GCSetMode(2) RegisterAbstractPath( "C:/Apps/Coding/Leadwerks Engine SDK" ) RegisterAbstractPath("Y:/Coding/Leadwerks/GunGore/data/models") AppTitle = "Test Graphics(800, 600) SeedRnd MilliSecs() Type tZombie Field v:TVec3 Field m:TMesh Field te:TEntity Field dead:Int Field mat:Int Field mat1:TMaterial = LoadMaterial("abstract::zombie_1.mat") Field mat2:TMaterial = LoadMaterial("abstract::zombie_2.mat") Field mat3:TMaterial = LoadMaterial("abstract::zombie_3.mat") Field mat4:TMaterial = LoadMaterial("abstract::zombie_4.mat") Field mat5:TMaterial = LoadMaterial("abstract::zombie_5.mat") Global zList:TList Function CreateZombie(xloc:Float, yloc:Float, zloc:Float, maxzombies:Int) If Not zList:TList Then zList:TList = CreateList() For Local xi:Int = 0 Until maxzombies Local z:tZombie = New tZombie z.m = LoadMeshGMF("abstract::zombie1.gmf") z.mat = Rand(1, 5) If z.mat = 1 Then PaintEntity(z.m, z.mat1) If z.mat = 2 Then PaintEntity(z.m, z.mat2) If z.mat = 3 Then PaintEntity(z.m, z.mat3) If z.mat = 4 Then PaintEntity(z.m, z.mat4) If z.mat = 5 Then PaintEntity(z.m, z.mat5) z.v = New TVec3 z.dead = 0 z.v.x = xloc z.v.y = yloc z.v.z = zloc zList.AddLast(z) Next End Function Method SetZPosition() PositionEntity(m, [v.x, v.y, v.z]) End Method End Type world=CreateWorld() If Not world RuntimeError "Failed to create world." gbuffer=CreateBuffer(GraphicsWidth(),GraphicsHeight(),BUFFER_DEPTH|BUFFER_COLOR0|BUFFER_COLOR1|BUFFER_COLOR2) camera = CreateCamera() PositionEntity camera, [0.0, 5.0, -2.0] Light = CreateDirectionalLight() RotateEntity Light, [45.0, 45.0, 45.0] SetLightRange(Light, 100.0) tZombie.CreateZombie(Rnd(-10.0, 10.0), 0.0, Rnd(0.0, 20.0), 10) For Local z:tZombie = EachIn tZombie.zList z.SetZPosition Next Repeat If KeyHit(KEY_ESCAPE) Exit If AppTerminate() Exit UpdateAppTime() UpdateWorld(AppSpeed()) SetBuffer(gbuffer) RenderWorld() SetBuffer(BackBuffer()) RenderLights(gbuffer) Flip(0) Forever gbuffer=Null FreeEntity light GCCollect() End
  3. Greetings all! Using BlitzMax is it better, within a type, to have a Field mesh:TMesh and use LoadMeshGMF for each instance or would it be better to load the mesh once then copy it for each instance? Ta!
  4. Hey Naughty, thanks for the welcome!
  5. I've had no problems at all with the Leadwerks fbx converter. I drag and drop on to the fbx2gmf.exe, drag my textures and drop on to the MakeDDS.exe then run GenMat in the directory with the new DDS files to generate the .mtl. It's pretty straight forward and very quick. I do not however get a difference with how the textures look i.e. I do not get a slight grainy texture or anything. It all looks as it is supposed to.
×
×
  • Create New...