Gamestudio Links
Zorro Links
Newest Posts
Trading Journey
by howardR. 04/28/24 09:55
basik85278
by basik85278. 04/28/24 08:56
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Help with plotting multiple ZigZag
by M_D. 04/26/24 20:03
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
M1 Oversampling
by jcl. 04/26/24 11:12
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Quad, AndrewAMD), 722 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
xXxGuitar's Normal Mapping Shader for Lite-C #141962
07/18/07 22:34
07/18/07 22:34
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline OP
Serious User
D3D  Offline OP
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
Few days back converted the Normal Mapping Shader from xXxGuitar in the User Contribution forum to Lite-C.
Download the demo.

Doom3 model exported by Kai Kieschnick. The model can't be used for any commercial project and was only taken to show the effect.

Code:
//--------------------------------------------------------------
// Normal Mapping Shader
//
// Matt_Aufderheide, Bloodline, William, xXxGuitar511
// -------------------------------------------------------------
// title: Normal Mapping Shader
// text: -
// -------------------------------------------------------------

#include <acknex.h>
#include <default.c>

// entry: FX File:
STRING* fxNM = "NM.fx";
STRING* MyAppTitle = "Normal Mapping Shader";

// section: Ambient Lighting:
// enable: Faked Dynamics
#define staFake
// enable: Ambience
#define staAmb

MATERIAL* comics =
{
ambient_blue = 100;
ambient_green = 100;
ambient_red = 100;
albedo = 0;
}

MATERIAL* mat_NM =
{
// section: Diffuse:
// entry: Red
diffuse_red = 255;
// entry: Green
diffuse_green = 255;
// entry: Blue
diffuse_blue = 255;

// section: Ambient:
// entry: Red
ambient_red = 16.0;
// entry: Green
ambient_green = 16.0;
// entry: Blue
ambient_blue = 16.0;

// // section: Sun:
// // entry: Red
// specular_red = 64.0;
// // entry: Green
// specular_green = 64.0;
// // entry: Blue
// specular_blue = 64.0;

// section: Static Lighting:
// entry: Red
emissive_red = 255.0;
// entry: Green
emissive_green = 255.0;
// entry: Blue
emissive_blue = 255.0;
//
flags = tangent | enable_render;
effect = fxNM;
//event = checkLight;
}


function effect_startup()
{
effect_load(mat_NM, fxNM);
//
var SLF;
while(1)
{
SLF = 0;
#ifdef staAmb
SLF += 1;
#endif
#ifdef staFake
SLF += 2;
#endif
//
vec_set(mat_NM.specular_blue, sun_color);
mat_NM.skill1 = pixel_for_vec(nullvector, SLF*10, 8888);
wait(1);
}
}

//function checkLight()
//{
// vec_set(temp, my.x);
// temp.z -= floor_range;
// c_trace(my.x, temp, ignore_me | scan_texture);
// mtl.skill1 = pixel_for_vec(tex_color, tex_light, 8888);
//}

#define _Red skill1
#define _Green skill2
#define _Blue skill3
#define _Range skill4
// action: Dynamic Light
// text: -
// skill1: Red 128
// skill2: Green 128
// skill3: Blue 128
// skill4: Range 300
action DLight()
{
my.red = my._Red;
my.green = my._Green;
my.blue = my._Blue;
my.lightrange = my._Range;
set(my,LIGHT);
}

void init_normal()
{
effect_startup();
}


action SpinMe()
{
while(1)
{
my.material = mat_NM;
my.pan -= 2 * time_smooth;
wait(1);
}
}

void main()
{
fps_max = 60;
video_mode = 6;
video_window(vector(375,350,0),NULL,112,MyAppTitle);
screen_color.blue = 125;
level_load("normal.wmb");
wait(2);
init_normal();
}




smile
Re: xXxGuitar's Normal Mapping Shader for Lite-C [Re: D3D] #141963
07/19/07 05:14
07/19/07 05:14
Joined: Feb 2006
Posts: 77
Schwäbisch Gmünd (nähe Stuttga...
M
maglat Offline
Junior Member
maglat  Offline
Junior Member
M

Joined: Feb 2006
Posts: 77
Schwäbisch Gmünd (nähe Stuttga...
I LOOOOVE this normal mapping shader. It looks so great. Thx for this great work


http://visit-ben.net
Com A7.82
current "big" Project : Undead Defender Adventure
Re: xXxGuitar's Normal Mapping Shader for Lite-C [Re: maglat] #141964
07/19/07 06:55
07/19/07 06:55
Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
frazzle Offline
Expert
frazzle  Offline
Expert

Joined: Mar 2006
Posts: 2,758
Antwerp,Belgium
Thanks for the effort D3D, I appriciate your work !!

Cheers

Frazzle


Antec® Case
Intel® X58 Chipset
Intel® i7 975 Quad Core
8 GB RAM DDR3
SSD OCZ®-VERTEX2 3.5 x4 ; HD 600 GB
NVIDIA® GeForce GTX 295 Memory 1795GB
Re: xXxGuitar's Normal Mapping Shader for Lite-C [Re: frazzle] #141965
07/21/07 03:03
07/21/07 03:03
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
yes, thanks again D3D. One day I'll jump into lite-c as I did with HLSL, though I'm sure lite-c will be much easier


xXxGuitar511
- Programmer
Re: xXxGuitar's Normal Mapping Shader for Lite-C [Re: xXxGuitar511] #141966
09/14/07 16:52
09/14/07 16:52
Joined: Jan 2007
Posts: 295
Portugal
Sam_Be Offline
Member
Sam_Be  Offline
Member

Joined: Jan 2007
Posts: 295
Portugal
hi
which of the scripts do i have to include into my mainscript?? and where can i change the textures and normalmaps??
thx
sam


GS-Extra Looking for a scripter Suche einen scripter. Estou a procura de um "Scripter".
Re: xXxGuitar's Normal Mapping Shader for Lite-C [Re: Sam_Be] #141967
11/02/07 18:35
11/02/07 18:35
Joined: Nov 2005
Posts: 94
Texas
3
3Dski Offline
Junior Member
3Dski  Offline
Junior Member
3

Joined: Nov 2005
Posts: 94
Texas
Wasn't able to access any of the realated URLs, so can not get NM.fx to even takeing the long way to viewing its usage. Can someone help?

EDITED: Actually, I was able to search on NM.fx under the Shaders category and able to find NM.fx there, as well as additional info : )

Last edited by 3Dski; 11/02/07 18:48.
Re: xXxGuitar's Normal Mapping Shader for Lite-C [Re: 3Dski] #141968
11/02/07 18:46
11/02/07 18:46
Joined: Apr 2006
Posts: 1,551
Netherlands
D3D Offline OP
Serious User
D3D  Offline OP
Serious User

Joined: Apr 2006
Posts: 1,551
Netherlands
The file is available on another host, try here.


smile

Moderated by  HeelX, Lukas, rayp, Rei_Ayanami, Superku, Tobias, TWO, VeT 

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