Glass Ball material

Blitz3D Forums/Blitz3D Programming/Glass Ball material

Picklesworth(Posted 2005) [#1]
Through a rather long story (which I won't waste your time by writing here), I was stricken by a rather good game idea. It started off with a graphics idea, then, after 8 hours in a zen-like state, it expanded to a full game. Quite fun :)

Anyway, what I need help with: I can not figure out how to make a shiny glass orb. I have done my own attempt with a spheremap, and it looks awful. The shininess is way too dull, and it all looks very boring.

;Graphics concept
	;'Go' style TBS game
	
;Do not use this particular file for the main module like you always do... Y`idiot.

AppTitle "Graphics concept - 'Go' style TBS game"
Graphics3D 800,600,0,2
SetBuffer BackBuffer()

camera=CreateCamera()
PositionEntity camera,0,10,0
;AmbientLight 200,200,200
light=CreateLight(2)
PositionEntity light,5,5,-2



char=CreateSphere();LoadMesh("media\meshes\characterA.3ds")
brushMain=CreateBrush()
BrushAlpha brushMain,0.2
sphereMap=LoadTexture("media\gfx\orb_spheremap.png",67)
BrushTexture brushMain,sphereMap
PaintEntity char,brushMain
PositionEntity char,0,1,8

box=CreateCube()
EntityColor box,150,150,150
PositionEntity box,0,-10,0
ScaleEntity box,10,10,10

While Not KeyDown(1)
	TurnEntity camera,MouseYSpeed()/2,-MouseXSpeed()/2,0
	MoveMouse GraphicsWidth()/2,GraphicsHeight()/2
	Local moveSpeed# ;Controlled with Shift key
    If KeyDown(42) Then moveSpeed#=0.05 Else moveSpeed#=0.2
	If KeyDown(30) Then MoveEntity camera,-moveSpeed,0,0
    If KeyDown(32) Then MoveEntity camera,moveSpeed,0,0
	If KeyDown(17) Then MoveEntity camera,0,0,moveSpeed
	If KeyDown(31) Then MoveEntity camera,0,0,-moveSpeed
	RenderWorld
	Flip
Wend

End


Here is media/gfx/orb/spheremap:
And another one I tried that may look better:


So... Can I get some help with doing decent shiny glass orbs? Like this image: http://images.google.com/images?q=tbn:AieH844UI7AJ:http://www.spdesign.co.uk/links/Final.jpg , except transparent (and a tiny bit more shininess, and I don't mind at all if it has one less spot).

(Quite obviously, I know nothing about this stuff)


DH(Posted 2005) [#2]
I would suggest:

Create a sphere, texture it with a mild gradient texture (lighter blue to a slightly less lighter blue),

create a texture which has your reflective lens spot on it and use it as a cube map on the sphere (static cube map)

Then make the sphere have an alpha of .4 or so. Place another sphere inside it slightly smaller with an alpha of say .5 or so (play with the alphas a bit), the inner sphere will have the same blue gradiant tex but no cube mapped light spot.

Play with the alphas a bit though. This should give you a nice glass orb effect.

If you want to go a bit further, change the cube map to dynamic (using a camera)and invert it on the sphere, this should give you a decent refractive image of everything around it.

This is merely theory though :-)


Sledge(Posted 2005) [#3]
I had similar thoughts to Dark Half. Off the top of my head...



Inverting the orb is problematic with spheremaps but I'm sure you can tweak it.

Tweaky:



Picklesworth(Posted 2005) [#4]
That refraction alone makes it ten times more satisfying.

Thanks!

(Now... How to make a procedural whitish sterile landscape that can be refracted... That's a fun puzzle :D )


Shifty Geezer(Posted 2005) [#5]
I've done similar. Using only two textures, create your basic sphere image with a reflection map, and then create a highlights texture with ADDITIVE blending. This gives nice shiny highlights