CTBM
(CTBM)
February 26, 2013, 8:01am
1
Just Been Playing around with the code for the light scattering filter and have managed to achieve this. I thought I’d share.
Tested with nVidia card, and have confirmation of working on ATI.
Tested with Blender 2.65a.
GodRays.blend (852 KB)
CTBM
2 Likes
brentison
(brentison)
February 26, 2013, 8:13am
2
Is that the code i’m seeing very intresting
Very nice, thanks for sharing.
I think something is going on when using different resolution. The rays act as expected when the viewport is a part of the window, but when maximized the rays act strange, the direction of the rays seem wrong, anyhow I would expect the rays behave the same independently of the resolution.
Windowed (as expected):
Maximized (strange direction of the rays):
Or maybe the maximized view is the correct behavior since the rays seems centered, not sure.
CTBM
(CTBM)
February 26, 2013, 8:30am
4
The Xpos/Ypos affects that, its currently set to render at 1920x1080, you can play with the settings to find the correct light position.
i’d make it dynamic to change according to window width, I just don’t have the time atm.
Ah, I see that now, thanks alot, this is really useful!
tales
(tales)
February 26, 2013, 2:24pm
8
ATI work and i have 60 fps
GraphiX
(GraphiX)
February 26, 2013, 7:12pm
9
Hmm. Now that I’ve actually got a change to look at it, it won’t work. Using 2.65a.
ndee
(ndee)
February 27, 2013, 3:19am
10
great filter CTBM!
Is this filter free to use? How about commercial usage?
CTBM
(CTBM)
February 27, 2013, 6:11am
11
use however you like, this is open source software isn’t it ?
ndee
(ndee)
February 27, 2013, 6:40am
12
well the software! but your blendfile and your code is under the licence you pusblish it! als long you do not bundle your code within the blenderplayer.exe you have full copyright to it!
but thanks
klauser
(klauser)
February 27, 2013, 7:55am
13
Many thanks for this. I love these ‘plug and play’ type filters that don’t require any setup and run relativity fast. Adds a nice touch to scenes and you exposed just enough variables to make it nicely tweakable.
tales
(tales)
February 27, 2013, 8:29am
14
wow klauser how did you do?
Thanks CTMB
CTBM
(CTBM)
February 27, 2013, 8:30am
15
I’ve never once used the “save to runtime” feature. i prefer compiling the code modules and encrypting the blends and using a launcher made in C++.
GraphiX
(GraphiX)
February 27, 2013, 10:23am
16
Any thoughts on it not running on my computer?
CTBM
(CTBM)
February 27, 2013, 10:34am
17
i dont know your computer.
could either be a resolution issue which can be fixed with adjusting the Xpos or Ypos. or its a graphics / OpenGL related issue.
JohnnyBlack
(JohnnyBlack)
February 27, 2013, 11:41am
18
Looks very nice,got to try it myself.
To get this to work on Linux, just add
#version 120
to the top of the shader file.
Great work, by the way!
Matpi
(Matpi)
March 6, 2013, 2:56am
20
Very nice!
I got it working on Win7 / NVidia GT650M by adding the “#version 120” code, too!
Blender 2.65a: 12 fps
Blender 2.66: between 11 and 14 fps
… probably my laptop is not the fastest computer ever! :eyebrowlift2: