Posted: 2nd Sep 2007 2:10
Here are some pics.

Without effect applied:


With effect applied as in above snippet.


With the lines
exclude object on hdr_experiment_objnum
hide object hdr_experiment_objnum
removed from code. Note the strange diagonal line running from the top left to the bottom right of the screen, and regularly spaced vertical lines running from the top of the screen to the diagonal line. These are spaced by 32 pixels in the texture. I don't know why this happens.

Posted: 2nd Sep 2007 5:53
OK i managed, with the help of Mr Kohlenstoff`s motion blur code, to get the HDR thing working, to an extent, with only one camera using a sprite, and it runs faster now. (and with optional motion blur!)
Trouble is it has those horrible lines. Have tried changing flags for just about everything but couldn't cure it. Will make an example but too sleepy right now..
Maybe i'll use the sprite still, but render two cameras, the second with all objects hidden and excluded.
Posted: 7th Sep 2007 17:45
@ Mr Tank. That effect looks nice. Thanks for sharing!

I've made a light effect. Here is the function:
+ Code Snippet
function light_setup(limnum,objnum,meshnum,distance,playerobjnum,litce,ghmode)
make object cube objnum,10
make mesh from object meshnum,objnum
delete object objnum
add limb playerobjnum,limnum,meshnum
offset limb playerobjnum,limnum,0,0,distance
delete mesh meshnum

make object cone litce,-400
scale object litce,70,200,50
xrotate object litce,90
fix object pivot litce
color object litce,0
set object ambient litce,0
ghost object on litce,ghmode
glue object to limb litce,playerobjnum,limnum
set object to object orientation litce,playerobjnum
endfunction


It's basically just a black cone, ghosted.

Here are some screenshots in a test map I made:



Hope you like it.
Posted: 7th Sep 2007 19:13
What a great idea. Looks very easy.. I always wondered how to realize such a technique. Great work.
Posted: 7th Sep 2007 19:26
Thanks! Glad you like it. Actually here's a better update of the function. I hope it will add some shine to your programs.

+ Code Snippet
function light_setup(limnum,objnum,meshnum,distance,playerobjnum,litce,,size,ghmode)
make object cube objnum,10
make mesh from object meshnum,objnum
delete object objnum
add limb playerobjnum,limnum,meshnum
offset limb playerobjnum,limnum,0,0,distance
delete mesh meshnum

make object cylinder litce,-size
scale object litce,70,2000,40
xrotate object litce,90
fix object pivot litce
color object litce,0
set object ambient litce,0
ghost object on litce,ghmode
glue object to limb litce,playerobjnum,limnum
set object to object orientation litce,playerobjnum
endfunction


It's more of an actual circle of light now. Anyway, glad you like it!
Posted: 7th Sep 2007 22:07
Sorry, wrong area (this post, that is).
Posted: 23rd Sep 2007 14:16
Sorry for the triple post...

Well, this is a sort of reflection effect. I just position another camera at the screen camera and rotate it to the same screen rotation, and get an image from that. I then texture an object with that texture, ghost it, and make another object 1 unit smaller. I think it gives the object(s) a nice semi/reflection look, although it isn't accurate.

Anyway, here's the function:
+ Code Snippet
function reflection(reflectcam,reflectobj,playercam,imgnum)
position camera reflectcam,camera position x(playercam),camera position y(playercam),camera position z(playercam)
yrotate camera reflectcam,camera angle y(playercam)
xrotate camera reflectcam,camera angle x(playercam)
zrotate camera reflectcam,camera angle z(playercam)
set camera to image reflectcam,imgnum,1024,1024
texture object reflectobj,imgnum
endfunction


And a demo:
+ Code Snippet
make matrix 1,1000,1000,20,20
hide mouse
make object cube 1,30
make object sphere 2,200
position object 2,500,0,500
`set object wireframe 2,1
make object sphere 3,199
position object 3,500,0,500
ghost object on 2
make camera 1
color backdrop 1,rgb(20,20,100)
y#=0
grav#=-0.5
stop=0
springable=1
vibrate=0

do
reflection(1,2,0,1)

set camera to follow object position x(1),object position y(1),object position z(1),y#,250,200,1700,0
point camera object position x(1),object position y(1),object position z(1)



if mouseclick()=0 then stop=0
if object position y(1)=<1 then springable=1 : else : springable=0
if object position y(1)=<0 then position object 1,object position x(1),0,object position z(1)
if mouseclick()=1 and stop=0 and springable=1 then grav#=0.5 : stop=1
move object up 1,grav#
if grav#=>-0.5 then grav#=grav#-0.0008



pcc_mouse(1,y#,250,200,1700)



yrotate object 1,y#
loop

function reflection(reflectcam,reflectobj,playercam,imgnum)
position camera reflectcam,camera position x(playercam),camera position y(playercam),camera position z(playercam)
yrotate camera reflectcam,camera angle y(playercam)
xrotate camera reflectcam,camera angle x(playercam)
zrotate camera reflectcam,camera angle z(playercam)
set camera to image reflectcam,imgnum,1024,1024
texture object reflectobj,imgnum
endfunction

function pcc_mouse(obj,ang#,distance,height,camsmooth)
set camera to follow object position x(1),object position y(1),object position z(1),ang#,distance,height,camsmooth,0
speed#=curvevalue(mousemovex()/4,speed#,0.00000000000000000000000000000000000000000000001)
move object right obj,speed#
speed2#=curvevalue(mousemovey()/4,speed2#,0.00000000000000000000000000000000000000000000001)
move object obj,-speed2#
endfunction


I hope you like it, and sorry again for the triple post.

Edit: Come on, more effects!
Here's a better version of my shine effect earlier on:

+ Code Snippet
function shine_2(shobject,originobject,brightness)
clone object shobject,originobject
color object shobject,rgb(brightness,brightness,brightness)
ghost object on shobject
glue object to limb shobject,originobject,0
endfunction ()


Hope you find it useful.