|
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
OP
Serious User
|
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(); }
|
|
|
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
Expert
|
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: xXxGuitar511]
#141966
09/14/07 16:52
09/14/07 16:52
|
Joined: Jan 2007
Posts: 295 Portugal
Sam_Be
Member
|
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
3Dski
Junior Member
|
Junior Member
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
OP
Serious User
|
OP
Serious User
Joined: Apr 2006
Posts: 1,551
Netherlands
|
The file is available on another host, try here.
|
|
|
|