Giles help

Community Forums/Developer Stations/Giles help

Boiled Sweets(Posted 2006) [#1]
I am new to Giles.

I load a mesh (my planks mesh for those following qoob) and lightmap it.

Then I save as 3ds. Giles creates the 3ds and a 2nd 3ds called planks_lmap. It also produces what looks like the light map texture too.

Now here is the confusing part.

If I load the planks.3ds it is the original without lighting.

If I load the planks_lmap it has no texture.

What am I missing here?

1. Am I suposed to save as b3d? If so why?
2. How can I associate my lightmap texture with my existing 3ds file?

Thanks.


Beaker(Posted 2006) [#2]
1. What is wrong with B3D? It is better cos you don't have to recombine the texture layers.
2. You need to copy the UVs from the 2nd model to the 2nd set of UVs in your first model. And then apply the lightmap texture to index 2 of your model.


Boiled Sweets(Posted 2006) [#3]
1. So the textures are built into the b3d file?
2. Can I not get Giles to create a 3ds with both textures in it?


Red Ocktober(Posted 2006) [#4]
you've gotta combine the textures onto the mesh... one is the lightmaped uv'd mesh, the other is the normal textured mesh...

set the lightmapped one with a bit of alpha and load both meshes in the same place... of course you're gonna run into artifacting issues doing it this way... export as .b3d... way better, and you use a single mesh...

--Mike


Boiled Sweets(Posted 2006) [#5]
So I load my mesh (with texture) into Giles. Add some lights do a render and save as b3d.

Then JUST load my b3d file into Blitz and whammo?


Red Ocktober(Posted 2006) [#6]
yup... Gile[s] is coool...

--Mike


Naughty Alien(Posted 2006) [#7]
..point is that 3ds cant store more than one UVmap set..thats why Giles export 2 meshes, one with difuse textures and another one only with lightmap aplied on to it...you can use 3DS in way you first load difuse textured mesh, than lightmaped, and then read and copy UV's from lighmaped to difuse maped mesh, and just free lightmaped mesh from memory and its done...of course its more easy to use straight B3D...here is code for 3DS version anyway..this is Halo's code i think, but I am not really sure..


Graphics3D 1280,1024,32,1

Global Log=WriteFile("log.txt")

camera=CreateCamera()

map=LoadAnimMesh("map.x")
litemap=LoadAnimMesh("lmap.x")
t=LoadTexture("Lmap.png")

MapVertices(map,litemap,t)
FreeEntity litemap
FreeTexture t

MoveEntity camera,0,200,-500
PointEntity camera,map

PositionEntity map,0,0,0
mirror=CreateMirror()
EntityAlpha map,0
;TurnEntity mirror,20,0,0

While Not KeyHit(1)
TurnEntity map,0,0.1,0

UpdateWorld
RenderWorld
Flip
Wend
End

;=====================
Function MapVertices(model,copy,texture)

WriteLine Log,"Limb "+EntityName(model)+" contains "+CountChildren(model)+" children, "+CountSurfaces(model)+" surfaces.
For n=1 To CountSurfaces(model)
surf=GetSurface(model,n)
WriteLine Log,"Limb "+EntityName(model)+", surface "+n+" contains "+CountVertices(surf)+" vertices."
Next

For n=1 To CountSurfaces(model)
WriteLine Log,"Testing surface "+n
surf=GetSurface(model,n)
lsurf=GetSurface(copy,n)
For v=0 To CountVertices(surf)-1
WriteLine Log,"Testing vertex "+v+1
tu#=VertexU#(lsurf,v)
tv#=VertexV#(lsurf,v)
tw#=VertexW#(lsurf,v)
VertexTexCoords surf,v,tu,tv,tw,1
Next
Next

WriteLine Log,""

TextureCoords texture,1
EntityTexture model,texture,0,1

For e=1 To CountChildren(Model)
limb=GetChild(model,e)
limb2=GetChild(copy,e)
MapVertices(limb,limb2,texture)
Next

End Function


Boiled Sweets(Posted 2006) [#8]
Is there any drawback to using just using the b3d. Saves a lot of messing around.


Naughty Alien(Posted 2006) [#9]
just load your B3D like this:
Level=Loadmesh("Level.B3D")
and all textures+ lightmap will be loaded together, of course be sure that all textures and lightmap is in same folder with your B3D file..


Boiled Sweets(Posted 2006) [#10]
Cool. qoob v.10 will look loads better...

The next mad plan I have is this, will it work?

Using this...

http://www.blitzbasic.com/codearcs/codearcs.php?code=866

Export my 'world' and load into Giles and lightmap it and then reimport.


Naughty Alien(Posted 2006) [#11]
yup..import in to giles everything giles supporting, do lightening, then export back as B3D and just load and it will work. Dont move imported files within giles becouse in that case your start position will not be same..