CameraClsColor replacement

Blitz3D Forums/Blitz3D Programming/CameraClsColor replacement

Naughty Alien(Posted 2008) [#1]
..is there any way to do same thing as CameraClsColor do, but, in such way that instead of one choosen color, I can set up gradiency ffrom one to another, something like gradient sky, where white color is horizon and going more blue up to the sky...


olo(Posted 2008) [#2]
go into the blitz3d command reference and go to 3d A-Z

Then click on 'camera fog mode', there is an example showing something similar to what you are looking for, just change the colors.


olo(Posted 2008) [#3]
here is an example which i made by changing that code a bit:
; CameraFogMode Example
; ---------------------

Graphics3D 640,480
SetBuffer BackBuffer()

;the camera
camera=CreateCamera()
PositionEntity camera,0,1,0

;the light
light=CreateLight()
RotateEntity light,90,0,0

;the ground
plane=CreatePlane()
grass_tex=LoadTexture( "media/mossyground.bmp" )
EntityTexture plane,grass_tex

; Set camera fog to 1 (linear fog) and the color of sky
CameraFogMode camera,1
CameraClsColor camera, 180,255,255

; Set camera fog range
CameraFogRange camera,1,100





While Not KeyDown( 1 )

	
	; Set camera fog color using red, green, blue values
	CameraFogColor camera,166,255,255

;moving the camera
	If KeyDown( 205 )=True Then TurnEntity camera,0,-1,0
	If KeyDown( 203 )=True Then TurnEntity camera,0,1,0
	If KeyDown( 208 )=True Then MoveEntity camera,0,0,-0.05
	If KeyDown( 200 )=True Then MoveEntity camera,0,0,0.05

	RenderWorld
		
	Flip
	
Wend

End


chack it out, hope it helps ;)


Ross C(Posted 2008) [#4]
Only thing i can think of is a quad, with a gradient texture on it.


Warner(Posted 2008) [#5]
Place the gradient in an image, then set CameraClsMode camera, 0, 1 When updating, first draw the image using DrawBlock before using RenderWorld().


Ross C(Posted 2008) [#6]
I reckon your best with a quad for speed reasons. Switching between 2d and 3d isn't great for speed, as it incurs a speed hit.


Naughty Alien(Posted 2008) [#7]
hmm...basically i had try few options, including graduated texture over skydome, but I would like to avoid any dome or skyboxes or stuff like that because of my cloud system as well as clipping functions..so what i want is simply setup basic color gradience for sky and then populate with specific clouds, matching given sky color scheme and that will do great job...single color based on CameraClsColor doing well, if i have some hills around and its really nice..but ability to do same but with gradiency between choosen colors will be really cool...


Vorderman(Posted 2008) [#8]
I'd just load a sprite with a gradient on it, then parent it to the camera and set the order so it draws first (behind everything else), and scale it so it just fills the screen. Simple and very fast.


miez(Posted 2008) [#9]
@Vorderman: yeah, that would work as long as you don't tilt the camera up or down. But you might be able to work with a sprite that's twice as high as the screen and move it down as the camera tilts up...


Ross C(Posted 2008) [#10]
Yep, just what i said the first time ;o) ;oP

miez, good idea.