I tried doing Fake HDR some time ago:
Type HDRObject
Field NRefference%
Field HRefference%
End Type
SeedRnd(MilliSecs())
Graphics3D(800,600,32,2)
SetBuffer(BackBuffer())
ThisCamera =CreateCamera()
ThisHDRCamera =CreateCamera()
Global ThisHDRSize# =512
Dim Sprites(100)
Dim Maps(100)
Dim ScreenPixels(GraphicsWidth(), GraphicsHeight())
Global ThisMapCnt
CameraViewport(ThisHDRCamera,0,0,ThisHDRSize,ThisHDRSize * .75)
ThisHDRTexture =CreateTexture(ThisHDRSize,ThisHDRSize,2+256)
ScaleTexture(ThisHDRTexture, Float(TextureWidth(ThisHDRTexture)) / (ThisHDRSize), Float(TextureHeight(ThisHDRTexture)) / (ThisHDRSize * .75) )
ThisSprite =CreateSprite()
brush=CreateBrush()
BrushFX brush,1
BrushTexture brush,ThisHDRTexture
PaintEntity ThisSprite,brush
MoveEntity(ThisSprite,0,0,1.0001)
SpriteViewMode ThisSprite,2
scale#=1.0/GraphicsWidth()
EntityBlend(ThisSprite,3)
ScaleSprite ThisSprite,GraphicsWidth()*scale,GraphicsHeight()*scale
Light =CreateLight()
ThisWorldPivot =CreatePivot()
;CreateBlur(ThisCamera)
Dim Cubes(100)
Dim CubeR#(100,3)
Global CubeCnt = 10
For ThisCnt = 1 To CubeCnt
ThisCube =CreateCube(ThisWorldPivot)
CreateHDRObject(ThisCube)
EntityColor(ThisCube,Rnd(50,255),Rnd(50,255),Rnd(50,255))
MoveEntity(ThisCube,Rnd(-4,4),Rnd(-4,4),Rnd(5,10))
Cubes(ThisCnt) =ThisCube
CubeR#(ThisCnt,1) =Rnd(-3,3)
CubeR#(ThisCnt,2) =Rnd(-3,3)
CubeR#(ThisCnt,3) =Rnd(-3,3)
Next
AntiAlias(1)
blur# = 0.1
While Not KeyDown(1)
For ThisCnt = 1 To CubeCnt
TurnEntity(Cubes(ThisCnt),CubeR#(ThisCnt,1),CubeR#(ThisCnt,2),CubeR#(ThisCnt,3))
Next
If KeyHit(2) Then blur# = 0.1
If KeyHit(3) Then blur# = 0.2
If KeyHit(4) Then blur# = 0.3
If KeyHit(5) Then blur# = 0.4
If KeyHit(6) Then blur# = 0.5
If KeyHit(7) Then blur# = 0.6
If KeyHit(8) Then blur# = 0.7
If KeyHit(9) Then blur# = 0.8
If KeyHit(10) Then blur# = 0.9
If KeyHit(11) Then blur# = 1.0
HideEntity(ThisSprite)
ShowEntity(ThisHDRCamera)
HideEntity(ThisCamera)
RenderHDRMask(ThisHDRCamera, ThisHDRTexture)
ShowEntity(ThisSprite)
;EntityAlpha(ThisSprite,.5)
ShowEntity(ThisCamera)
HideEntity(ThisHDRCamera)
RenderNormal(ThisCamera)
Flip()
Wend
End
Function RenderNormal(ThisCamera)
CameraClsColor(ThisCamera,0,0,0)
Local ThisHO.HDRObject
For ThisHO = Each HDRObject
EntityAlpha(ThisHO\NRefference,1)
EntityAlpha(ThisHO\HRefference,0)
Next
RenderWorld()
End Function
Function RenderMap(ThisCamera, ThisSize#, ThisX#, ThisY#, ThisZ#)
ThisMapCnt =ThisMapCnt + 1
ThisMap =CreateTexture(ThisSize,ThisSize,2+256)
ScaleTexture(ThisMap, Float(TextureWidth(ThisMap)) / (ThisSize), Float(TextureHeight(ThisMap)) / (ThisSize * .75) )
RotateEntity(ThisCamera, ThisX, ThisY, ThisZ)
CameraViewport(ThisCamera,0,0,ThisSize,ThisSize * .75)
RenderWorld()
CopyRect(0,0,ThisSize,ThisSize*.75,0,0,BackBuffer(),TextureBuffer(ThisMap))
Return(ThisMap)
End Function
Function RenderHDRMask(ThisCamera, ThisTexture)
CameraClsColor(ThisCamera,255,255,255)
Local ThisHO.HDRObject
For ThisHO = Each HDRObject
EntityAlpha(ThisHO\NRefference,0)
EntityAlpha(ThisHO\HRefference,1)
Next
ThisNewBlurr =1
If ThisNewBlurr Then
ThisTotal =5
ThisSize# =32
ThisJitter# =0
For ThisCnt = 1 To ThisTotal
Maps(ThisCnt) =RenderMap(ThisCamera, ThisSize#, Rnd(-ThisJitter,ThisJitter), Rnd(-ThisJitter,ThisJitter),0)
ThisC =ThisC + 1
;If ThisC =3 Then
ThisSize = ThisSize * 2
; ThisC = 0
;EndIf
Next
For ThisSprt = 1 To ThisTotal
Sprites(ThisSprt) =CreateSprite(ThisCamera)
ThisSprite1 =Sprites(ThisSprt)
ThisMap =Maps(ThisSprt)
EntityBlend(ThisSprite1 ,3)
;DebugLog "Scan:"+ThisSprt+" Map:"+ThisMap
EntityTexture(ThisSprite1,ThisMap)
Var# =.02 * (Float(ThisSprt) / ThisSpriteCnt)
MoveEntity(ThisSprite1,0,0,1.0001)
scale#=1.0/GraphicsWidth()
ScaleSprite ThisSprite1,GraphicsWidth()*scale,GraphicsHeight()*scale
EntityAlpha(ThisSprite1, 1.0 / ThisTotal)
;DebugLog ThisSprt
Next
CameraViewport(ThisCamera,0,0,ThisHDRSize,ThisHDRSize * .75)
RenderWorld()
CopyRect(0,0,ThisHDRSize,ThisHDRSize*.75,0,0,BackBuffer(),TextureBuffer(ThisTexture))
ThisDealy()
For ThisSprt = 1 To ThisTotal
FreeEntity(Sprites(ThisSprt))
FreeTexture(Maps(ThisSprt) )
Next
EndIf
CameraClsColor(ThisCamera,0,0,0)
For ThisHO = Each HDRObject
EntityAlpha(ThisHO\NRefference,0)
EntityAlpha(ThisHO\HRefference,0)
Next
End Function
Function CreateHDRObject(ThisOBject)
Local ThisHO.HDRObject
ThisHO =New HDRObject
ThisHO\NRefference =ThisOBject
ThisHO\HRefference =CopyEntity(ThisOBject)
EntityColor(ThisHO\HRefference,0,0,0)
EntityParent(ThisHO\HRefference,ThisHO\NRefference)
End Function
Function ThisDealy()
;Flip():Delay(1000)
End Function
The trick behind FakeHDR is to render the scene with all objects set to black (with a white camera background). Take that render, blur it (extreme blur), and apply it to a sprite overlay with the sprite blend mode set to add (3). Then render the scene again with all objects normal color, the background being your sky or whatever, and the alpha intensity of the sprite overlay being the amount your 'eye corona' should be opened (IE the eye ajusting to the light intensity would close the corona, thus alphaing the sprite to 0).
Limitation:
No way to blur the image fast in Blitz (well, no way to blur it satisfactory). Rendering multipler resolutioned images of the mask to a single texture produces grainy results (in the above code), and doesnt get a good blur (or even the extreme blur you need). Doing per-pixel operations are just too slow to even consider (Even on a 128x128). Lastly per pixel operations is what you would want as you need an average amount of light shown by the mask so you can constantly adjust the corona (sprite alpha) to actually produce the realtime part of fakeHDR.
Blitz3D just has too many limitations to do this even close to poorly.
You know, that this behavior on HDR is hardware side (ok driver) and not shader?
Actually you can do psuedo-HDR on software end (and not hardware) pretty quickly given the right approach.
Some reading material showing psuedo-HDR done on the playstation:
http://www.dyingduck.com/sotc/making_of_sotc.html