Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Home-Made Lensflare + (update) Cloud Layers  (Read 2193 times)
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« on: July 09, 2004, 11:55:55 PM »

Here's the result of 3-days-experimentation on Genesis v2 Pro's lens flares... I think it kicks ass, but with all those lenses and rays, it can get pretty slow; I have a 50-fps drop when I look directly at the flare, because TV3D (or my videocard Cheesy )  seems to have difficulty in rendering big 2d sprites...

Anyway. It's a combination of TVAtmosphere's Sun and TVScreen2DImmediate's rotated textures. The flare and rays get bigger as you look towards the sun direction, and the secondary flares fade when you look away. The rays also rotate as you look around.
I tested with different colors (i.e. sunset/sunrise) and it works well for that too.

Enjoy Smiley

WMV9 Video : http://tfhtl.thebobs.org/HoursScreens/Flare/HoursCatalyst%20Lensflare%20Showcase.wmv

And some shots for the lazy and 28.8k among us...

Blocked by an obstacle (flare disabled)


Flare shown


When looking directly at it


--update--
Since I had problems with my web server lately and this topic either didn't get much viewers, or the server was just down, thought I'd update it with my latest clouds... Tongue



Working on the atmosphere is great fun Cheesy
Logged

Makubab
Customers
Community Member
*****
Posts: 114


« Reply #1 on: July 10, 2004, 12:22:44 AM »

looks cool, and very bright in the last pic
Logged
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #2 on: July 12, 2004, 04:04:29 PM »

*bump*age.
Logged

Dimple
Community Member
*
Posts: 580


« Reply #3 on: July 12, 2004, 06:32:30 PM »

:lol:  sniff 28.8k er's!!!  Ya gotta be kidding.  My modems a 56k, though it usually logs in at about 45333 bps which is not all that great either. Heh!
Anyhow about the video effect, flair up if you will; that youv'e made would be great in a space game that has a sun going nova as you are trying
to hall arse out of the system ....  Any hints for people making a space type game about how you did that.....
Logged

Using VB.NET, TV3D 6.5, VISTA
~~~~~~~~~~~~~~~~~~~~~~~

"Know how to ask. There is nothing more difficult for some people, nor for others, easier."

- Baltasar Gracian
Zaknafein
Customers
Community Member
*****
Posts: 2940


WWW
« Reply #4 on: July 12, 2004, 07:31:46 PM »

Oh, sure I don't mind giving up some hints...
For the sun size, I calculate it using (mainly) those three VB.Net lines :

Code:
DistanceFactor = GetVectorLength(SubVectors(GetNormalizedVector(mSunPosition), PlayerCamera.CamLookAt))
FlareSize = (Math.Max(0.25! - DistanceFactor, 0)) * 5
RelativeSize = ViewportSize * FlareSize + ViewportSize / 10


The first one gets a "distance factor", a number for some reason between -1.5 and 1.5, which represents how big is the angle between you and the sun. The cam LookAt vector can be obtained easily; it's the 3rd row of the camera's rotation matrix.
The second calculates a size based on that angle. I use Max so that the sun only "grows" when you look in a very tight angle (0.25 vector length).
The third takes the size and makes it compatible with all viewport sizes. I use "(Width + Height) / 2" for the ViewportSize var. The "+ ViewportSize / 10)" gives the standard size; when isn't all shiny and big.

The sprit is then drawn using additive blending, on the 3d-to-2d position of the sun object.
All the rays basically use this technique at different sizes, except for the rays which get rotated when the VectorLength changes...  Smiley
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks