To danielwooden

Miscellaneous Forums/General Discussion/To danielwooden

I must see a demo of this: http://www.blitzmax.com/gallery/view_pic.php?id=1193&gallery=&page=1

Do you have an exe to show off?
This looks nice :-)

As a matter of fact I do! Give me your email address or better yet send me an email at dan.wooden@... and i'll send you a little demo.

Sent

Check your mail!

Yeah, that is nice! I sent you a few responses.

Very nice effect

Niiiiiice effect. Are you releasing this or what?

very Burnout 3!

That's what FPS games need next. Red Faction allowed you to blow junks from walls which was a nice novelty while it lasted. But what people should really look into is being able to blow the corner of a building away using a rocket launcher and have bricks and wood scatter around the area. Even have parts of the building collapse into itself or around itself. Just like in real life. I'm sure you could make a demo of this with all this hardware power thats lying around the place.

If anyone would like a demo email me at dan.wooden@... and I would be happy to send it to you with source.

Indie goes digging for some code to share. Oh and sorry for the hijack.

Tweak it a little and have some fun. Each entity can be included or excluded from the filter at runtime.

BLURFACTOR# = 0.91
scrW = 640
scrH = 480
Graphics3D scrW, scrH, 8, 2
SetBuffer BackBuffer()

Include "MOD_DreamFilter.bb"



AmbientLight 255, 255, 255
SeedRnd MilliSecs()

cam = CreateCamera()

filter1 = DreamFilter_Create(cam,256,1.022,220,220,220,100,1.1,0.001)





Meshes = 20
Dim objMeshes(Meshes)

For i = 0 To Meshes
	Select Rand(1, 4)
		Case 1
			objMeshes(i) = CreateCube()
			DreamEntity_Add(objMeshes(i),False)
		Case 2
			objMeshes(i) = CreateSphere(8)
			DreamEntity_Add(objMeshes(i))
		Case 3
			objMeshes(i) = CreateCylinder(8)
			DreamEntity_Add(objMeshes(i))
		Case 4
			objMeshes(i) = CreateCone(8)
			DreamEntity_Add(objMeshes(i))
	End Select
	ScaleEntity objMeshes(i), Rnd(0.2, 0.4), Rnd(0.2, 0.4), Rnd(0.2, 0.4)
	MoveEntity objMeshes(i), Rnd(0, 6) - 3, Rnd(0, 4) - 2, Rnd(3, 10)
	RotateEntity objMeshes(i), Rnd(0, 360), Rnd(0, 360), Rnd(0, 360)
	col = Rand(60, 255)
	EntityColor objMeshes(i), col , col, col
Next

While Not KeyDown(1)

	tmrStart = MilliSecs()
	i = i + 5
	
	
	;MoveEntity cam,0,0,Cos(i)/80
	TurnEntity cam,0,0,.02

	DreamFilter_Update(cam,Filter1)

	RenderWorld
	If total = 0 Then
		total = 1
	End If
	Text 0, 0, total + "ms | " + 1000 / total + "FPS | " + TrisRendered() + " tris"
	Flip 0

	total = MilliSecs() - tmrStart
	
Wend

MOD_DreamFilter.bb
; ***********************************************************************************
; MOD_DreamFilter Copyright Indiepath 2004

DebugLog "MOD_Dreamfilter.bb"

;Include "LIB_Render2Tex.bb"

;InitialiseR2T()

; ***********************************************************************************

; NO GLOBALS ALLOWED!

Type DreamFilter
	Field TextureSize
	Field MotionZoom#
	Field FeedbackRed,FeedbackGreen,FeedbackBlue
	Field Strength#
	Field Position#
	Field Offset#
	Field BlurMesh
	Field BlurSurface
	Field BlurTexture
	Field Show
	;Field R2THolder
End Type

Type DreamEntity
	Field Entity
	Field Show
End Type


; *********************************************************************************

Function DreamEntity_Add(entity,show=True)    ; EXCLUDE FROM DREAM RENDER

	Local e.DreamEntity = New DreamEntity
	e\Entity = Entity
	e\Show = Show
	Return Handle(e)

End Function

; *********************************************************************************

Function DreamEntity_Remove(ent)

	Local e.DreamEntity = Object.DreamEntity(ent)
	Delete e
	
End Function

; *********************************************************************************

Function DreamEntity_State(ent,state)
	Local e.DreamEntity = Object.DreamEntity(ent)
	e\Show = State
End Function


; *********************************************************************************

Function DreamFilter_Create(cam,TexSize = 256,MotionZoom#=1.022,FeedBackRed=220,FeedBackGreen=220,FeedBackBlue=220,Strength#=100,Position#=1.1,Offset#=0.001)
	
	Local d.DreamFilter = New DreamFilter
	
	
	d\Show			= True
	d\TextureSize 	= TexSize
	d\MotionZoom# 	= MotionZoom#
	d\FeedbackRed 	= FeedbackRed
	d\FeedbackGreen = FeedbackGreen
	d\FeedbackBlue 	= FeedbackBlue
	d\Strength# 	= Strength#
	d\Position#		= Position#
	d\Offset#		= Offset#

	d\BlurMesh		= CreateMesh(cam)
	d\BlurSurface 	= CreateSurface(d\BlurMesh)
	d\BlurTexture 	= CreateTexture(d\TextureSize,d\TextureSize,256+1+16+32)
	EntityTexture 	d\blurMesh, d\BlurTexture
	
;	d\R2THolder = NewRenderTexture(TexSize,TexSize)
;	rt.RenderTexture = Object.RenderTexture(d\R2THolder)
;	MakeRenderTexture(d\BlurTexture,rt)

	AddVertex   	d\BlurSurface, -1, 1, 0, 0, 0
	AddVertex   	d\BlurSurface,  1, 1, 0, 1, 0
	AddVertex   	d\BlurSurface, -1,-1, 0, 0, 1
	AddVertex   	d\BlurSurface,  1,-1, 0, 1, 1
	AddTriangle 	d\BlurSurface, 0, 1, 2
	AddTriangle 	d\BlurSurface, 3, 2, 1

	PositionEntity 	d\BlurMesh,-d\Offset#,d\Offset#, d\Position#
	ScaleEntity   	d\BlurMesh,d\MotionZoom# * d\Position#,d\MotionZoom# * d\Position#,1.0
	EntityOrder 	d\BlurMesh,  -10000
	EntityFX 		d\BlurMesh, 1
	EntityBlend    	d\BlurMesh, 3
	
	Return Handle(d)
	
End Function

; *********************************************************************************

Function DreamFilterShow(filter,show=1)

	d.DreamFilter = Object.DreamFilter(Filter)
	d\Show = show
	If show Then
		ShowEntity d\BlurMesh
	Else
		HideEntity d\BlurMesh
	EndIf
	
End Function



; *********************************************************************************

Function DreamFilter_Destroy(filter)

	d.DreamFilter = Object.DreamFilter(Filter)
	FreeTexture d\BlurTexture
	FreeEntity  d\BlurMesh
	Delete d
 	
End Function

; *********************************************************************************

Function DreamFilter_Update(cam,filter)

	d.DreamFilter = Object.DreamFilter(Filter)

	If Not d\Show Then Return

	CameraViewport 	Cam, 0, 0, d\TextureSize, d\TextureSize
	EntityColor 	d\BlurMesh, d\FeedbackRed,d\FeedbackGreen,d\FeedbackBlue
	
	For e.DreamEntity = Each DreamEntity
		If Not e\show Then HideEntity e\Entity
	Next
;	CameraRange cam,1,10
	RenderWorld 
;	CameraRange cam,1,1000
	CopyRect  		0,0,d\TextureSize,d\TextureSize, 0, 0, BackBuffer(), TextureBuffer(d\BlurTexture)
	CameraViewport 	Cam,0,0,GraphicsWidth(),GraphicsHeight()
	EntityColor 	d\BlurMesh, d\Strength# ,d\Strength# ,d\Strength# 
	
	For e.DreamEntity = Each DreamEntity
		ShowEntity e\Entity
	Next
	
End Function


@Indiepath - Neat! That works very well. I have learned a couple of things from reading your code that I will try and implement into my lib.

If anyone else would like the source to my project write me an email. Or, if anyone would be kind enough to host my file for me :) that would be great!

Hi Daniel,
You can go here: http://www.kidsgamming.com/community/ - create an account - I should get an email - and I'll get you set up to post files.

It's a site I'm just playing around with - my kids are just starting to get interested in coding so I'm working up a little community site for their group.

But, feel free to post anything you'd like - I belive there is more than enough space and bandwith.

Any questions, just email me sampyxis at yahoo

I don't have B3D, so the source is uselessto me. Hmph.

But I'll host the file for you, daniel. No problem.

email me at andrew.suderman2@...

@sampyxis - Thanks! I will sign up soon. That is great that your children are getting into programming.

@drew - Check your mail and thanks again.

Great stuff, Indiepath! thanks! :D

Did this ever get uploaded? I was looking forward to seeing it. If you want, mail it to me via support@... and I'll be happy to host it.

Hmm, I never got any email. The address I gave looks
correct. Did you really send it, daniel?

(I don't have any spam-blockers on that account, so it couldn't be that)

@drew - Yes I sent it but it came back with an error message. I tried twice. Do you have another email address that I could try?

@BlitzSupport - Thanks, I just sent you an email.

Try mediamonger@...

I don't know why the other one wouldn't work. Hmm.