Generating a Normal Map

Started by
51 comments, last by Geometrian 13 years, 6 months ago
Cheers for that, check out that shader I linked above what you think. Apart from that I'm not to fond of billboarding, I personally would like to stay away from it for this project, apart from my particle effects :D

Well this shader gives some results but something is still wrong. You can only ever see it on the weirdest angles. I'm taking a guess it may be how i'm getting the vecViewPos:

float4 vecViewPos;
vecViewPos = xView[3];

float3 Viewer = wpos.xyz - vecViewPos.xyz;
Output.View=Viewer;

I added the AtmoPS and AtmoVS to my shader so it looks like this now:
http://pastebin.com/wZQ0PYe0

On a weird angle from the outside. Can only be seen on this angle really:
description of your image

Inside the planet:
description of your image

[Edited by - Scottehy on October 22, 2010 5:21:50 AM]
Advertisement
Quote:Original post by Scottehy
I'm thinking of looking into something like atmospheric scattering.
The state-of-the-art in atmospheric scattering for planets is Eric Bruneton's work - worth checking out even if you don't plan to implement it.
Quote:But I'm just wondering if there is an easier way to apply a glow around them.
Alex Peterson did some very nice work in approximating atmospheric scattering with lookup textures, a little while back. The complexity vs. quality he achieved might suit your project very well.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

I've seen some of this stuff by Eric, it's beautiful isn't it. The other link you gave me looks perfect. Pretty much exactly what I wanted. Thanks :)
I dont get it, how does it get the blurry light around the outside of the planet?!?!?
Hi,

Glad you seem to have gotten it working. However, you might find it useful to calculate the tangent and binormal via simpler methods in the future. The method that comes to mind for me for a sphere is (pseudocode):

//maybe needs a couple of negatives in some places
up = vec3(0,1,0);
T = cross(N,up);
B = cross(N,T);

Basically, based on the observation that the normal of a unit sphere is also its position, and that the tangent vector will therefore be in the same spherical coordinate space as the positions. The matrices will prove useful for more complicated models, but often simpler solutions can be found with a little thought.

-G

[size="1"]And a Unix user said rm -rf *.* and all was null and void...|There's no place like 127.0.0.1|The Application "Programmer" has unexpectedly quit. An error of type A.M. has occurred.
[size="2"]

This topic is closed to new replies.

Advertisement