Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
4 registered members (AndrewAMD, bigsmack, 7th_zorro, dr_panther), 1,364 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Halo glow. help a nubie #31201
07/28/04 06:27
07/28/04 06:27
Joined: Mar 2004
Posts: 277
Zagreb
R
r00tsh3ll Offline OP
Member
r00tsh3ll  Offline OP
Member
R

Joined: Mar 2004
Posts: 277
Zagreb
Hi,
I have this (old but working ) glow shader.
I was wandering if someone is willing to tudor me how to rewrite it for GS.
Any help typed here is wellcomed. Please talk to me like Im 3 years old since shaders are really strangers to me.

Here is teh shader:

Code:
 #include "Constants.h"

// v0 -- position
// v1 -- normal
// CV_SCALING = (edgesize, 0.0f, 0.0f, 0.0f)

vs.1.0

mul r4, v1, c[CV_SCALING].xxxy
add r4, v0, r4

// transform position
dp4 oPos.x, r4, c[CV_WORLDVIEWPROJ_0]
dp4 oPos.y, r4, c[CV_WORLDVIEWPROJ_1]
dp4 oPos.z, r4, c[CV_WORLDVIEWPROJ_2]
dp4 oPos.w, r4, c[CV_WORLDVIEWPROJ_3]

// transform normal
dp3 r0.x, v1, c[CV_WORLD_IT_0]
dp3 r0.y, v1, c[CV_WORLD_IT_1]
dp3 r0.z, v1, c[CV_WORLD_IT_2]

// normalize normal
dp3 r0.w, r0, r0
rsq r0.w, r0.w
mul r0, r0, r0.w

// compute world space position
dp4 r1.x, r4, c[CV_WORLD_0]
dp4 r1.y, r4, c[CV_WORLD_1]
dp4 r1.z, r4, c[CV_WORLD_2]

// vector from point to eye
add r2.xyz, c[CV_EYE], -r1

// normalize e
dp3 r2.w, r2, r2
rsq r2.w, r2.w
mul r2, r2, r2.w

//alpha value
dp3 oD0.w, r0, r2
mov oD0.xyz, c[CV_COLOR]



constants file:

Code:
 #define CV_WORLDVIEWPROJ_0 0
#define CV_WORLDVIEWPROJ_1 1
#define CV_WORLDVIEWPROJ_2 2
#define CV_WORLDVIEWPROJ_3 3

#define CV_LIGHT_DIRECTION 4

#define CV_WORLD_IT_0 5
#define CV_WORLD_IT_1 6
#define CV_WORLD_IT_2 7
#define CV_WORLD_IT_3 8

#define CV_CONSTANTS 9

#define CV_EYE 10

#define CV_WORLD_0 11
#define CV_WORLD_1 12
#define CV_WORLD_2 13
#define CV_WORLD_3 14

#define CV_SCALING 15
#define CV_COLOR 16



its from nvidia effectsBrowser.

Re: Halo glow. help a nubie [Re: r00tsh3ll] #31202
07/28/04 10:28
07/28/04 10:28
Joined: Jul 2004
Posts: 31
Rendering on a Pipeline
Buluen Offline
Newbie
Buluen  Offline
Newbie

Joined: Jul 2004
Posts: 31
Rendering on a Pipeline
so is the shader like a glow as on geometry (bump ,env mapping?) or like the glow from the sun ?

Re: Halo glow. help a nubie [Re: Buluen] #31203
07/28/04 10:42
07/28/04 10:42
Joined: Jul 2004
Posts: 1,710
MMike Offline
Serious User
MMike  Offline
Serious User

Joined: Jul 2004
Posts: 1,710
if its like sun ..it woul be very useful.. i love that halo sun effect...

Re: Halo glow. help a nubie [Re: MMike] #31204
07/29/04 01:50
07/29/04 01:50
Joined: Mar 2004
Posts: 1,201
Switzerland, Baselland
Bird Offline
Senior Developer
Bird  Offline
Senior Developer

Joined: Mar 2004
Posts: 1,201
Switzerland, Baselland
can you post a picture? amt i can't try the code self, because i'm in holiday!


- A6pro 6.40.5

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1