Worklog for Kalisme
shaKAL
Return to Worklogs| 
 | ||
| Hey there everybodies.... Finally got shaKAL 0.5 and HOLE:retouch up on the net... Please note: *I'm hoping to re-write shaKAL soon to make easier to read. *Hole: retouch is a tech demo using shaKAL *I haven't check the speed for these downloads Hole: retouch http://www.uploading.com/files/DDHTIINP/hole_retouch.zip.html shaKAL 0.5 & tutorials http://www.uploading.com/files/DII9REKX/tutorial1.zip.html Feed back please. --------------------- my current projects: ...*shrugs* Learning SDL via DevC++ | 
| 
 | ||
| well, things are getting a little stressful (currently job hunting), 
but I'm considering getting back into the games devolpment 
scene....Unfortunatley these TAFE computers don't seem to let people 
upload files to the net (darn)... I'll try to use the university computers, but if not I might need to ask someone if I can Email them files to add to my mediafire acount... Oh well... shaKAL is still at 0.5... Really wanting to do some freeware games... --------------------- my current projects: ...*shrugs* Learning SDL via DevC++ | 
| 
 | ||
| After posting that odd update of that tech demo I released when I was 
15, I noticed a wierd glitch in my ol' shaKAL shadow culling code... so I
 used some older code I wrote, which worked better (wierd, eh?) I didn't think I'd return to this project (or programming, depressingly enough) because I was WAY too wrapped up in my course and producing "artwork". Luckily a friend got me back into playing video games... so I became interested in programming again. I shall post the new verson ASAP. --------------------- my current projects: ...*shrugs* Learning SDL via DevC++ | 
| 
 | ||
| I have recently done some more work on shaKAL... here are files for the 0.3 release: http://download.35mb.com/kalisme/shaKAL0_3.zip http://download.35mb.com/kalisme/terrain%20demo.zip http://download.35mb.com/kalisme/tutorials.zip Get the required *.decls & *.dll to work with this at: www.blitzbasic.com/codearcs/codearcs.php?code=1191 or: www.freewebs.com/elias_t/tribox_dll.zip (they are required to run the shadow library) (sorry for being so blunt, but it's too hot today!) Hope someone finds this work of interest. I'm still working on shaKAL. -Kevin Laherty --------------------- my current projects: ...*shrugs* Learning SDL via DevC++ | 
| 
 | ||
| Here is version 0.25. Fixed a glitch causing jagged shadowcamera movement & added shadow culling for terrains. (experimental) www.freewebs.com/elias_t/tribox_dll.zip <--you'll need this. In short, thanyou to the support of two blitzers, I've decided to continue work on shaKAL.... expect updates... but know I might be slower inbetween updates now because I'm using TAFE internet to update and I'm currently teaching myself c++ & SDL. a scene without shaKAL: (before shadows) The same scene WITH a shadow: A better scene: (still primitives though) Tally-ho & pip pip then... Till next time, -Kevin Laherty --------------------- my current projects: ...*shrugs* Learning SDL via DevC++ | 
| 
 | ||
| Erm... I just tried to download my own files (the shaKAL libs)... 
(yeah... I download my own stuff now and again... I check if they still 
work.) But unfortunatley www.filelodge.com doesn't seem to exist anymore!! :o Well... I'll sort it out I guess. But if anyone wants to help... I'm not gonna say no :P Oh, and if anyone wants shaKAL emailed to them or something, just eamail me at kalisme@... it might take a few days for me to reply since I'm using the tafes internet.... but I'll reply. Just make sure to add "shaKAL" in the subject. (my hotmail presumes most poeple are junkmail... very odd.) -Kevin Laherty --------------------- my current projects: ...*shrugs* Learning SDL via DevC++ | 
| 
 | ||
| well... this isn't really an update... I haven't done much... I fiddled around with shaKAL in the hollidays a little... but I was quite busy learning C++ and studying stuff... There wasn't much intrest in the project... I might continue if I get some spare time and a good idea (they do come... sometimes.) But I might shove up a simple tutorial I wrote so that it's easy to understand the basis of writting your own shadow engine... I admit mine was a tad fiddley... I'll have a look at the tutorial tonight and see if I can shorten it down or something.... hopefully I'll upload it this week sometime. Well, that's all for now. Thankyou for those who supported shaKAL. If you did have any intrest in the project, feel free to Email me: kalisme@... (I think I just need motivation... lack of feedback & intrest sorta kills the thrill of coding freeware opensource stuff... I know I sound like an attention seeker, but I'm sure some of you out there can understand.) I want to continue TRYING to contribute to this great comunity so I want to continue coding in blitz3d, but I know I have to get more seriousley into c++ if I ever want to get anywhere in the industry. -Kevin Laherty --------------------- my current projects: ...*shrugs* Learning SDL via DevC++ | 
| 
 | ||
| http://www.filelodge.com/files/room17/427152/shaKALv02.zip there it is! I just uploaded it! version 0.2 is alot nicer than 0.1, but still not a version 1.0... not yet. :( Next I hope to restructure my code so it's easyier to re-write and learn from. (aren't I nice?) Get the required *.decls & *.dll to work with this at: www.blitzbasic.com/codearcs/codearcs.php?code=1191 or: www.freewebs.com/elias_t/tribox_dll.zip (they are required to run the shadow library) thankyou for reading... any support would be great :D -Kevin Laherty --------------------- my current projects: ...*shrugs* Learning SDL via DevC++ | 
| 
 | ||
| I've currently got a stable 0.2... (I guess) I'm just trying to tidy it up before I post it... Now the shadows are only casted onto the sides of the mesh that have light hitting them. Here's something I want to say to anyone who has tryed or is using shaKAL: -with the rotatable receivers.... it turns out they are very dodgey... I shall have to work on the code more.... (grrrr)... but changing the "yaw" in real time seems ok... but pitch and roll are being a real hassle. -DO NOT SCALE RECEIVERS WITH "scaleentity", use "scalemesh". Well... I shall post a new version ASAP... My next goal is culling unlit terrain mesh polygons. Since I don't think I can post in the hollidays, I might work on deKAL... then make a tech demo using my recent work... Thanks for reading, -Kevin Laherty --------------------- my current projects: ...*shrugs* Learning SDL via DevC++ | 
| 
 | ||
| erg.... here is a patched version of 0.1... my rotateble receivers were very flawed.... (grrr) they didn't like "roll" being played with... I don't think it minds now... I was going to release this in a v 0.15, but I found a bug in the code I was using for culling unlit normals... well... hope 0.15 comes soon. Best of wishes ; ShaKAL
;version 0.1   + rotatable receiver patch fixes flaw in original release.
Global shakal_terrain_nudge#=3
Dim mess(100,100)    ;<-test
Global Terrain_shadow_detail=40
Type kShl
	Field	ent,dis#
End Type
Type kShob
	Field	ent,hi#,fat#,sclx#,piv#
End Type
Type kShr
	Field	ent
End Type
Type kShr_ter
	Field	ent,x_scale#,z_scale#
End Type
Type kmsh
	Field	ob,lite,mesh,surf,texy
End Type
Type kSh_d ;dev mode types
	Field	ent,box,hi#,fat#,sclx#,piv#
End Type
Global shaKAL_camera_range#=700
Global blur_cam_x#=65536.0
Global blur_cam_y#=65536.0
Global blur_cam_z#=0.0
Global blur_times=1
Global blur_radius#=1
Global diss#
Global dis#
Global shadbox_x
Global shadbox_y
Global shadbox_z
Global shadbox_sx
Global shadbox_sy
Global shadbox_sz
;---------------------int box
Dim TriVertex(3)
Dim TriVx#(3)
Dim TriVy#(3)
Dim TriVz#(3)
Dim TriVnx#(3)
Dim TriVny#(3)
Dim TriVnz#(3)
Dim TriVdot#(3)
Dim ShadowVertex(3)
Global bank=CreateBank(15*4)
Global ksh_ng#=.00005     ;<---nudge vertesies  
Global  ssize=64     ;<----shadow size
shadbox_x=50
shadbox_y=-5000
shadbox_z=50
shadbox_sx=50
shadbox_sy=50
shadbox_sz=50
Global ksh_pivvy=CreatePivot()
Global ksh_sdpiv=CreatePivot()
Global ksh_cam =CreateCamera()                   ;<----camera for shadows
CameraRange ksh_cam,1,shaKAL_camera_range#
CameraViewport ksh_cam,0,0,ssize,ssize 
CameraClsColor ksh_cam,255,255,255
CameraProjMode ksh_cam,2
CameraFogMode ksh_cam,1
CameraFogColor ksh_cam,255,255,255
Function create_light(ent,dis#)
c_light=0
For d.kshl = Each kshl
If d\ent=ent Then c_light=1
Next
If c_light=1 Then Goto skip_create_light
	d.kshl=New kshl
	d\ent=ent
	d\dis#=dis
.skip_create_light
End Function
Function draw_light(cam)
For d.kshl = Each kshl
CameraProject cam,EntityX(d\ent,1),EntityY(d\ent,1),EntityZ(d\ent,1) ;moo
Line ProjectedX()+Cos(Rnd(360))*20,ProjectedY()+Sin(Rnd(360))*20,ProjectedX(),ProjectedY()
Text ProjectedX()+2,ProjectedY()+15,"light source"
Next
End Function 
Function create_caster(ent,hi#,fat#,scalex#,piv_offset#)
c_cast=0
For d.kshob = Each kshob
If d\ent=ent Then c_cast=1
Next
If c_cast=1 Then Goto skip_create_caster
	d.kshob=New kshob
	d\ent=ent
	d\hi#=hi#
	d\fat#=fat#
	d\sclx#=scalex#
	d\piv=piv_offset#
	.skip_create_caster
End Function
Function draw_caster(cam)
For d.kshob = Each kshob
CameraProject cam,EntityX(d\ent,1),EntityY(d\ent,1),EntityZ(d\ent,1)
Line ProjectedX()-15,ProjectedY(),ProjectedX()+15,ProjectedY()
Line ProjectedX(),ProjectedY()-15,ProjectedX(),ProjectedY()+15
Text ProjectedX()+2,ProjectedY()+15,"caster"
Next
End Function 
Function create_receiver(ent)
c_receiver=0
For d.kshr = Each kshr
If d\ent=ent Then c_receiver=1
Next
If c_receiver=1 Then Goto skip_create_receiver
	d.kshr=New kshr
	d\ent=ent
	
.skip_create_receiver
End Function
Function create_terrain_receiver(ent,x#,z#)
c_terrain_receiver=0
For d.kshr_ter = Each kshr_ter
If d\ent=ent Then c_terrain_receiver=1
Next
If c_terrain_receiver=1 Then Goto skip_create_terrain_receiver
	d.kshr_ter=New kshr_ter
	d\ent=ent
	d\x_scale#=x#
	d\z_scale#=z#
.skip_create_terrain_receiver
End Function
Function update_ks(g_cam)
CameraRange ksh_cam,1,shaKAL_camera_range#
killshads()
For a.kshl = Each kshl
  For b.kshob = Each kshob
createcopy(a\ent,b\ent,b\hi#,b\fat#,b\piv#,a\dis#,b\sclx#,g_cam)
  Next
Next
End Function
Function killshads()
For c.kmsh = Each kmsh
If c\mesh <> 0 Then 	ClearSurface c\surf:FreeTexture c\texy:FreeEntity c\mesh: Delete c
Next
End Function
Function createcopy(ligt,mesh,hi#,fat#,offset#,ldis#,scalex#,g_cam)
CameraViewport ksh_cam,0,0,ssize,ssize 
Local shadbox=CreateCube()
EntityColor shadbox,255,255,255
PositionEntity shadbox,shadbox_x,shadbox_y,shadbox_z
ScaleEntity shadbox,shadbox_sx,shadbox_sy,shadbox_sz
EntityFX shadbox,1
EntityOrder shadbox,-2
offset_piv=CreatePivot()
PositionEntity offset_piv,EntityX(mesh,1),EntityY(mesh,1),EntityZ(mesh,1)
RotateEntity offset_piv,EntityPitch(mesh,1),EntityYaw(mesh,1),EntityRoll(mesh,1)
MoveEntity offset_piv,0,offset#,0
PositionEntity ksh_pivvy,EntityX(ligt,1),EntityY(ligt,1),EntityZ(ligt,1)
PointEntity ksh_pivvy,offset_piv
dis#=EntityDistance(ksh_pivvy,offset_piv)
If dis# > ldis#+1 Then Goto skipc2
	c.kmsh=New kmsh
c\texy=CreateTexture(ssize,ssize,16+32)
c\mesh= CreateMesh()
c\surf  = CreateSurface(c\mesh)
PositionEntity ksh_cam,EntityX(ligt,1),EntityY(ligt,1),EntityZ(ligt,1)
PointEntity ksh_cam,offset_piv
CameraZoom ksh_cam,.06/scalex#
PositionEntity ksh_pivvy,EntityX(ligt,1),EntityY(ligt,1),EntityZ(ligt,1)
PointEntity ksh_pivvy,offset_piv
dis#=EntityDistance(ksh_pivvy,offset_piv)
ndis#=ldis#-dis#
MoveEntity ksh_pivvy,0,0,dis#+ndis#
pfox=EntityX(ksh_cam,1)-EntityX(mesh,1)
pfoy=EntityY(ksh_cam,1)-EntityY(mesh,1)
pfoz=EntityZ(ksh_cam,1)-EntityZ(mesh,1)
obx#=EntityX(offset_piv,1)
oby#=EntityY(offset_piv,1)
obz#=EntityZ(offset_piv,1)
sbx#=EntityX(ksh_pivvy,1)
sby#=EntityY(ksh_pivvy,1)
sbz#=EntityZ(ksh_pivvy,1)
bsw#=sbx#-obx#
bsh#=sby#-oby#
bsd#=sbz#-obz#
cbx#=obx#+((bsw)*.5)
cby#=oby#+((bsh)*.5)
cbz#=obz#+((bsd)*.5)
If bsw#<0 Then bsw#=bsw#*-1
If bsh#<0 Then bsh#=bsh#*-1
If bsd#<0 Then bsd#=bsd#*-1
bsw#=bsw#+(fat#*2)
bsh#=bsh#+(hi#*2)
bsd#=bsd#+(fat#*2)
PokeFloat bank,0,cbx#
PokeFloat bank,4,cby#
PokeFloat bank,8,cbz#
PokeFloat bank,12,bsw#*.5
PokeFloat bank,16,bsh#*.5
PokeFloat bank,20,bsd#*.5
For d.kshr = Each kshr
If d\ent = offset_piv Then Goto scopym
If d\ent = mesh Then Goto scopym
RotateMesh d\ent,EntityPitch(d\ent),0,0
RotateMesh d\ent,0,EntityYaw(d\ent),0
RotateMesh d\ent,0,0,EntityRoll(d\ent)
surfaces = CountSurfaces(d\ent)
   For LOOP_Surface = 1 To Surfaces
		
		Surface_Handle = GetSurface(d\ent, LOOP_Surface)
        Tris = CountTriangles(Surface_Handle)
		
		For LOOP_Tris = 0 To Tris-1
				For LOOP_Verts = 0 To 2
					TriVertex(LOOP_Verts) = TriangleVertex(Surface_Handle, LOOP_Tris, LOOP_Verts)
					TriVx#(LOOP_Verts) = VertexX#(Surface_Handle, TriVertex(LOOP_Verts)) + EntityX(d\ent,1)
					TriVy#(LOOP_Verts) = VertexY#(Surface_Handle, TriVertex(LOOP_Verts)) + EntityY(d\ent,1)
					TriVz#(LOOP_Verts) = VertexZ#(Surface_Handle, TriVertex(LOOP_Verts)) + EntityZ(d\ent,1)
					TriVnx#(LOOP_Verts) = VertexNX#(Surface_Handle, TriVertex(LOOP_Verts))+EntityPitch(d\ent)
					TriVny#(LOOP_Verts) = VertexNY#(Surface_Handle, TriVertex(LOOP_Verts))+EntityYaw(d\ent)
					TriVnz#(LOOP_Verts) = VertexNZ#(Surface_Handle, TriVertex(LOOP_Verts))+EntityRoll(d\ent)								Next
;triangle vertices
;v0
PokeFloat bank,24,trivx#(0)
PokeFloat bank,28,trivy#(0)
PokeFloat bank,32,trivz#(0)
;v1
PokeFloat bank,36,trivx#(1)
PokeFloat bank,40,trivy#(1)
PokeFloat bank,44,trivz#(1)
;v2
PokeFloat bank,48,trivx#(2)
PokeFloat bank,52,trivy#(2)
PokeFloat bank,56,trivz#(2)
If triBox(bank) = 1
															
	For LOOP_Verts = 0 To 2			
	ShadowVertex(LOOP_Verts) = AddVertex(c\surf, TriVx#(LOOP_Verts)+(TriVnx#(LOOP_Verts)*ksh_ng#), TriVy#(LOOP_Verts)+(TriVny#(LOOP_Verts)*ksh_ng#), TriVz#(LOOP_Verts)+(TriVnz#(LOOP_Verts)*ksh_ng#))
												
	Next															
									
	AddTriangle(c\surf, ShadowVertex(0), ShadowVertex(1), ShadowVertex(2))
										
EndIf		
Next
Next
EntityAlpha c\mesh,1
RotateMesh d\ent,0,0,-EntityRoll(d\ent)
RotateMesh d\ent,0,-EntityYaw(d\ent),0
RotateMesh d\ent,-EntityPitch(d\ent),0,0
.scopym
Next
;============================================================================================
;============================================================================================
;============================================================================================
sizex#=Float(bsw*1.125)/Terrain_shadow_detail
sizez#=Float(bsd*1.125)/Terrain_shadow_detail
For e.kshr_ter = Each kshr_ter
max_x#=EntityX(e\ent)+(TerrainSize(e\ent) * e\x_scale#)
max_z#=EntityZ(e\ent)+(TerrainSize(e\ent) * e\z_scale#)
x_box_min#=cbx#-((sizex#*Terrain_shadow_detail)*.5)
x_box_max#=cbx#+((sizex#*Terrain_shadow_detail)*.5)
z_box_min#=cbz#-((sizez#*Terrain_shadow_detail)*.5)
z_box_max#=cbz#+((sizez#*Terrain_shadow_detail)*.5)
If x_box_min# < max_x# Then If x_box_max# > EntityX#(e\ent) Then If z_box_min# < max_z Then If z_box_max# > EntityZ#(e\ent) Then 
 For b=0 To Terrain_shadow_detail
  For a=0 To Terrain_shadow_detail
def_x#=cbx#-((sizex#*Terrain_shadow_detail)*.5)+(a*sizex#)
def_z#=cbz#-((sizez#*Terrain_shadow_detail)*.5)+(b*sizez#)
If def_x#<EntityX#(e\ent) Then def_x#=EntityX(e\ent)
If def_x#>max_x# Then def_x#=max_x#
If def_z#<EntityZ#(e\ent) Then def_z#=EntityZ#(e\ent)
If def_z#>max_z# Then def_z#=max_z#
y#=TerrainY(e\ent,def_x#,0,def_z#)+shakal_terrain_nudge#
mess(a,b)= AddVertex (c\surf,def_x#,y#,def_z#)
  Next
 Next
 For b=0 To Terrain_shadow_detail-1
  For a=0 To Terrain_shadow_detail-1
   AddTriangle c\surf,mess(a,b),mess(a+1,b),mess(a+1,b+1)
   AddTriangle c\surf,mess(a,b),mess(a,b+1),mess(a+1,b+1)
  Next
 Next
EndIf
Next
;============================================================================================
;============================================================================================
;============================================================================================
EntityFX mesh,8+1
EntityColor mesh,0,0,0
EntityOrder mesh,-2
HideEntity g_cam 
ShowEntity ksh_cam 
TextureBlend c\texy,3
temp_mesh=CopyEntity(mesh)
PositionEntity temp_mesh,shadbox_x,shadbox_y,shadbox_z
PositionEntity ksh_cam,shadbox_x+pfox,shadbox_y+pfoy,shadbox_z+pfoz
RenderWorld()
PositionEntity ksh_cam,EntityX(ligt,1),EntityY(ligt,1),EntityZ(ligt,1)
ShowEntity g_cam
Color 255,255,255
Rect 1,1,ssize-1,ssize-1,0
Rect 0,0,ssize,ssize,0
CopyRect 0,0,ssize,ssize,0,0,BackBuffer(),TextureBuffer(c\texy) 
For s=1 To CountSurfaces(c\mesh) 
surf=GetSurface(c\mesh,s) 
For v=0 To CountVertices(surf)-1 
TFormPoint VertexX(surf,v),VertexY(surf,v),VertexZ(surf,v),c\mesh,ksh_cam
VertexTexCoords surf,v,(TFormedX()/scalex#)/32+0.5,1-((TFormedY()/scaleX#)/32+.5)
PositionEntity ksh_sdpiv,VertexX(surf,v)+EntityX(c\mesh,1),VertexY(surf,v)+EntityY(c\mesh),VertexZ(surf,v)+EntityZ(c\mesh)
dis2# =EntityDistance(ksh_sdpiv,ksh_cam)
diss#=(ldis#-dis2#)/ldis#
dis#=1-diss#
VertexColor surf,v,(128*dis#)*2,(128*dis#)*2,(128*dis#)*2
Next 
Next 
HideEntity g_cam
ShowEntity ksh_cam 
;------------------------------------------------------------------------------------
blur_quality=blur_times
If blur_quality > 0
Local blurmesh[16*4]
Local loop
Local blur_cam
	RotateEntity ksh_cam,90,0,0,True
	PositionEntity ksh_cam, blur_cam_x#, blur_cam_y#, blur_cam_z#
CameraZoom ksh_cam,1
	For loop = 0 To (blur_quality*4)-1
			blurmesh[loop] = CreateCube()
	Next
	
	blurradius#=blur_radius#*(1.0/256.0)
	bluranglestep#=360.0/Float(blur_quality*4)
	blurshade = Ceil(255.0/Float(blur_quality*4))
	
	For loop=0 To (blur_quality*4)-1
			EntityTexture blurmesh[loop],c\texy
			EntityColor blurmesh[loop],255*(1.0/Float(loop+1)),255*(1.0/Float(loop+1)),255*(1.0/Float(loop+1))
			ScaleEntity blurmesh[loop],1,.001,1
			blurangle# = bluranglestep# * Float(loop) + 180.0*(loop Mod 2)
			xoff# = blurradius# * Cos(blurangle#)
			yoff# = blurradius# * Sin(blurangle#)
			PositionEntity blurmesh[loop], blur_cam_x#+xoff#, blur_cam_y#-5.0, blur_cam_z# + yoff#, True
			If loop> 1 Then EntityBlend blurmesh[loop],2
	Next
	RenderWorld
Rect 1,1,ssize-1,ssize-1,0
Rect 0,0,ssize,ssize,0
CopyRect 0,0,ssize,ssize,0,0,BackBuffer(),TextureBuffer(c\texy) 
			For loop = 0 To (blur_quality*4)-1
					FreeEntity blurmesh[loop]
			Next
	
EndIf
;--------------------------------------------------------
ShowEntity g_cam
HideEntity ksh_cam
PositionEntity ksh_cam,EntityX(ligt,1),EntityY(ligt,1),EntityZ(ligt,1)
CameraZoom ksh_cam,.06/scalex#
.skip_blur
EntityTexture c\mesh,c\texy
EntityBlend c\mesh,2
EntityFX c\mesh,1+2+8+16
EntityFX mesh,0
EntityColor mesh,128,128,128
EntityOrder mesh,0
HideEntity ksh_cam 
FreeEntity temp_mesh
.skipc2
FreeEntity shadbox
FreeEntity offset_piv
HideEntity ksh_cam
End Function
Function remove_caster(ent)
For d.kshob = Each kshob
If d\ent=ent Then Delete d
Next
End Function 
Function remove_light(ent)
For d.kshl = Each kshl
If d\ent=ent Then Delete d
Next
End Function 
Function remove_receiver(ent)
For d.kshr = Each kshr
If d\ent=ent Then Delete d
Next
End Function 
Function remove_terrain_receiver(ent)
For d.kshr_ter = Each kshr_ter
If d\ent=ent Then Delete d
Next
End Function 
;--------------------------------------------------------
; dev mode functions
;--------------------------------------------------------
Function create_dev_caster(ent,hi#,fat#,scalex#,piv_offset#)
c_cast=0
For d.ksh_d = Each ksh_d
If d\ent=ent Then c_cast=1
Next
If c_cast=1 Then Goto skip_create_caster
	d.ksh_d=New ksh_d
	d\ent=ent
	d\box=CreateCube()
	d\hi#=hi#
	d\fat#=fat#
	d\sclx#=scalex#
	d\piv=piv_offset#
ScaleEntity d\box,fat#,hi#,fat#
PositionEntity d\box,0,piv_offset#,0
EntityAlpha d\box,.5
EntityColor d\box,0,200,0
	.skip_create_caster
End Function
Function draw_dev_caster(ent,light,g_CAM,x,y)
HideEntity g_cam
ShowEntity ksh_cam
CameraViewport ksh_cam,x,y,ssize,ssize 
For d.ksh_d = Each ksh_d
If d\ent=ent Then 
PositionEntity d\box,EntityX(d\ent),EntityY(d\ent),EntityZ(d\ent)
RotateEntity d\box,EntityPitch(d\ent,1),EntityYaw(d\ent,1),EntityRoll(d\ent,1)
MoveEntity d\box,0,d\piv,0
RotateEntity d\box,0,0,0
offsetpiv=CreatePivot()
PositionEntity offsetpiv,EntityX(d\ent,1),EntityY(d\ent,1),EntityZ(d\ent,1)
RotateEntity offsetpiv,EntityPitch(d\ent,1),EntityYaw(d\ent,1),EntityRoll(d\ent,1)
MoveEntity offsetpiv,0,d\piv,0
PositionEntity ksh_cam,EntityX(light,1),EntityY(light,1),EntityZ(light,1)
PointEntity ksh_cam,offsetpiv
CameraZoom ksh_cam,.06/d\sclx#
RenderWorld()
Color 255,255,255
Rect x+1,y+1,ssize-1,ssize-1,0
Rect x,y,ssize,ssize,0
Text x,y-25,"scaleX: " + d\sclx#
Text x,y-15,"pivot offset: " + d\piv
EndIf
Next
HideEntity ksh_cam
ShowEntity g_cam
End Function 
Function show_dev_caster(ent)
For d.ksh_d = Each ksh_d
If d\ent=ent Then ShowEntity d\box
Next
End Function 
Function hide_dev_caster(ent)
For d.ksh_d = Each ksh_d
If d\ent=ent Then HideEntity d\box
Next
End Function 
Function remove_dev_caster(ent)
For d.ksh_d = Each ksh_d
If d\ent=ent Then FreeEntity d\box : Delete d
Next
End Function (oh... this is just a patch I guess... you still need a download of a shaKAL library... just look downwards) --------------------- my current projects: ...*shrugs* Learning SDL via DevC++ | 
| 
 | ||
| YAY! I finally placed up a new download for shaKAL. http://www.filelodge.com/files/room17/427152/shaKAL%20v01.zip this is version 0.1 (yup.... finally gonna start giving them numbers) this has the new library, the old tutorial, and a demonstration of the new terrain receivers. I'm in a rush... but I hope this is helpful :) --------------------- my current projects: ...*shrugs* Learning SDL via DevC++ | 
| 
 | ||
| yup... just like my new goal for deKAL (hey, c'mon... they work off the same basis! it's just that one is constantly updated!) I'm going to add terrain shadows! (for blitz terrains) wouldn't that be nifty? Like I said in my deKAL log... I've played some Halo recently and WAY too much MorrowWind... I think the blitzterrains are very underused in blitz games... and it's because they seem sooooo uncompatible with so many things I guess... (good shadows, accurate normal mapping, physics... blah blah... blah!) I've figured out how to work it... I just need to add it into shaKAL. It will work alot like towl meshing. So towl meshing for terrains, box collision detected meshes for mesh receivers... but the textures will work the same way (same way of calculating the uv map) Well... Hope this will help... I'll get to work ASAP so I can upload a working demo (with source) ASAP. REALLY hoping I can help the comunity in some way... because they help me LOTS! --------------------- my current projects: ...*shrugs* Learning SDL via DevC++ | 
| 
 | ||
| Yup, here's a four part tutorial on adding my library to a scene... http://www.filelodge.com/files/room17/427152/demonstration.zip I hope this is easy to understand, all opensource, I hope someone can find this useful :) you'll need to get the required *.decls & *.dll to work with this at: www.blitzbasic.com/codearcs/codearcs.php?code=1191 good luck, and thankyou for reading :) -Kevin Laherty --------------------- my current projects: ...*shrugs* Learning SDL via DevC++ | 
| 
 | ||
| ERG! the newest download is like 3.2 meg :( anywho, I've included "development mode" functions... mainly "create_dev_caster", which creates a fake caster... instead of casting a shadow, it creates a green box around the object to show the height and width settings for the caster. And "Draw_dev_caster" which renders what the shadow camera is seeing so you can see the scaleing and camera zoom better... (to make sure the object sits inside the viewport) here it is: http://www.filelodge.com/files/room17/427152/newer%20test.zip Hope this helps. --------------------- my current projects: ...*shrugs* Learning SDL via DevC++ | 
| 
 | ||
| http://www.filelodge.com/files/room17/427152/new%20test.zip This has the new commands that I talked about in it as well as bluring. Hope it works well. I have alot of work to do on this tonight. I hope I can give an update tomorrow. --------------------- my current projects: ...*shrugs* Learning SDL via DevC++ | 
| 
 | ||
| last night I opened up my library and noticed I was missing some really simple and IMPORTANT commands.. :o so I added "remove_caster" and "remove_light" commands. I also played with a blur effect... it just re-rendered the texture on a box and added 2 layers on-top of it... then looped for the amount of blurring you asked for. It looked nice with a quick 1X blur... but the more blurring made an offset with the texture and made the shadow look wrong... Well I printed off the blurtexture() command from the archives (by Sswift)... thankyou to devils child to pointing it out :D I'll update and post a new download soon. --------------------- my current projects: ...*shrugs* Learning SDL via DevC++ | 
| 
 | ||
| Hey y'all... This is my first worklog... I hope this project goes well... this is all open source... here is a REALLY early shot I did: (progress was killed for a while.... my computer died... but I got a new one last week... and started work again 2 days ago) I did alot of work last night, and now it looks more like this: you can download my current progress here: (watch out... it's a slow download :( ) http://www.filelodge.com/files/room17/427152/showcase%20shadows.zip Special thanx to the following people: Tomas Moller & elias_t - for giving the box>polygon collision detection to the blitz comuntity :D TigerZ -for donating the kickass 3d model balchak to this project! to get in touch with me, you can Email: kalisme@... and to see my site, you can visit: www.kalisme.tk I hope I am helpful, thanx for reading, -Kevin Amos Laherty -oh... quick add... I forgot to add: Get the required *.decls & *.dll to work with this at: http://www.blitzbasic.com/codearcs/codearcs.php?code=1191 or: www.freewebs.com/elias_t/tribox_dll.zip --------------------- my current projects: ...*shrugs* Learning SDL via DevC++ |