Import irrlicht 1.8.4 release
BIN
media/001shot.jpg
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
media/002shot.jpg
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
media/003shot.jpg
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
media/004shot.jpg
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
media/005shot.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
media/006shot.jpg
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
media/007shot.jpg
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
media/008shot.jpg
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
media/009shot.jpg
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
media/010shot.jpg
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
media/011shot.jpg
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
media/012shot.jpg
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
media/013shot.jpg
Normal file
After Width: | Height: | Size: 8.6 KiB |
BIN
media/014shot.jpg
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
media/015shot.jpg
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
media/016shot.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
media/017shot.jpg
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
media/018shot.jpg
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
media/019shot.jpg
Normal file
After Width: | Height: | Size: 4.4 KiB |
BIN
media/020shot.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
media/021shot.jpg
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
media/022shot.jpg
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
media/023shot.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
media/024shot.jpg
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
media/025shot.jpg
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
media/026shot.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
media/2ddemo.png
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
media/Faerie5.BMP
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
media/IrrlichtTheme.ogg
Normal file
BIN
media/Particle.tga
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
media/axe.jpg
Normal file
After Width: | Height: | Size: 64 KiB |
BIN
media/ball.wav
Normal file
BIN
media/bigfont.png
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
media/burninglogo.png
Normal file
After Width: | Height: | Size: 14 KiB |
29
media/config.xml
Normal file
@ -0,0 +1,29 @@
|
||||
<?xml version="1.0"?>
|
||||
<config>
|
||||
<!--This is a config file for the Irrlicht Engine Mesh Viewer.-->
|
||||
<startUpModel file="dwarf.x" />
|
||||
<messageText caption="Irrlicht Engine Mesh Viewer">Welcome to the Mesh Viewer of the "Irrlicht Engine"!.
|
||||
This program is able to load and display all 3D geometry and models the Irrlicht Engine can.
|
||||
Controls: Left mouse to rotate, right mouse to move, both buttons to zoom. Escape to Stop FPS Camera
|
||||
|
||||
Supported formats are:
|
||||
- Irrlicht scene and mesh formats (.irr, .irrmesh, .xml)
|
||||
- 3D Studio (.3ds)
|
||||
- Blitz3D (.b3d)
|
||||
- COLLADA 1.2/1.3 (.dae, .xml)
|
||||
- Cartography shop 4 (.csm)
|
||||
- DirectX (.x)
|
||||
- DeleD (.dmf)
|
||||
- Maya (.obj)
|
||||
- Milkshape (.ms3d)
|
||||
- My3D (.my3D)
|
||||
- OCT (.oct)
|
||||
- Ogre3d (.mesh)
|
||||
- Pulsar LMTools (.lmts)
|
||||
- Quake 3 levels (.bsp)
|
||||
- Quake 2 models (.md2)
|
||||
- Stanford Triangle (.ply)
|
||||
- Stereolithography format (.stl)
|
||||
|
||||
</messageText>
|
||||
</config>
|
10
media/d3d8.psh
Normal file
@ -0,0 +1,10 @@
|
||||
; part of the Irrlicht Engine Shader example.
|
||||
; This simple Direct3D9 pixel shader will be loaded by the engine.
|
||||
; Please note that these example shaders don't do anything really useful.
|
||||
; They only demonstrate that shaders can be used in Irrlicht.
|
||||
|
||||
ps.1.1
|
||||
|
||||
tex t0 ; sample color map
|
||||
mul_x2 t0, t0, v0 ; mulitply with color
|
||||
add r0, t0, t0 ; make it brighter and store result
|
37
media/d3d8.vsh
Normal file
@ -0,0 +1,37 @@
|
||||
; part of the Irrlicht Engine Shader example.
|
||||
; This Direct3D9 vertex shader will be loaded by the engine.
|
||||
; Please note that these example shaders don't do anything really useful.
|
||||
; They only demonstrate that shaders can be used in Irrlicht.
|
||||
|
||||
vs.1.1
|
||||
|
||||
; transpose and transform position to clip space
|
||||
mul r0, v0.x, c4
|
||||
mad r0, v0.y, c5, r0
|
||||
mad r0, v0.z, c6, r0
|
||||
add oPos, c7, r0
|
||||
|
||||
; transform normal
|
||||
dp3 r1.x, v1, c0
|
||||
dp3 r1.y, v1, c1
|
||||
dp3 r1.z, v1, c2
|
||||
|
||||
; renormalize normal
|
||||
dp3 r1.w, r1, r1
|
||||
rsq r1.w, r1.w
|
||||
mul r1, r1, r1.w
|
||||
|
||||
; calculate light vector
|
||||
m4x4 r6, v0, c10 ; vertex into world position
|
||||
add r2, c8, -r6 ; vtxpos - lightpos
|
||||
|
||||
; normalize light vector
|
||||
dp3 r2.w, r2, r2
|
||||
rsq r2.w, r2.w
|
||||
mul r2, r2, r2.w
|
||||
|
||||
; calculate light color
|
||||
dp3 r3, r1, r2 ; dp3 with negative light vector
|
||||
lit r5, r3 ; clamp to zero if r3 < 0, r5 has diffuce component in r5.y
|
||||
mul oD0, r5.y, c9 ; ouput diffuse color
|
||||
mov oT0, v3 ; store texture coordinates
|
84
media/d3d9.hlsl
Normal file
@ -0,0 +1,84 @@
|
||||
// part of the Irrlicht Engine Shader example.
|
||||
// These simple Direct3D9 pixel and vertex shaders will be loaded by the shaders
|
||||
// example. Please note that these example shaders don't do anything really useful.
|
||||
// They only demonstrate that shaders can be used in Irrlicht.
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Global variables
|
||||
//-----------------------------------------------------------------------------
|
||||
float4x4 mWorldViewProj; // World * View * Projection transformation
|
||||
float4x4 mInvWorld; // Inverted world matrix
|
||||
float4x4 mTransWorld; // Transposed world matrix
|
||||
float3 mLightPos; // Light position
|
||||
float4 mLightColor; // Light color
|
||||
|
||||
|
||||
// Vertex shader output structure
|
||||
struct VS_OUTPUT
|
||||
{
|
||||
float4 Position : POSITION; // vertex position
|
||||
float4 Diffuse : COLOR0; // vertex diffuse color
|
||||
float2 TexCoord : TEXCOORD0; // tex coords
|
||||
};
|
||||
|
||||
|
||||
VS_OUTPUT vertexMain(in float4 vPosition : POSITION,
|
||||
in float3 vNormal : NORMAL,
|
||||
float2 texCoord : TEXCOORD0 )
|
||||
{
|
||||
VS_OUTPUT Output;
|
||||
|
||||
// transform position to clip space
|
||||
Output.Position = mul(vPosition, mWorldViewProj);
|
||||
|
||||
// transform normal
|
||||
float3 normal = mul(float4(vNormal,0.0), mInvWorld);
|
||||
|
||||
// renormalize normal
|
||||
normal = normalize(normal);
|
||||
|
||||
// position in world coodinates
|
||||
float3 worldpos = mul(mTransWorld, vPosition);
|
||||
|
||||
// calculate light vector, vtxpos - lightpos
|
||||
float3 lightVector = worldpos - mLightPos;
|
||||
|
||||
// normalize light vector
|
||||
lightVector = normalize(lightVector);
|
||||
|
||||
// calculate light color
|
||||
float3 tmp = dot(-lightVector, normal);
|
||||
tmp = lit(tmp.x, tmp.y, 1.0);
|
||||
|
||||
tmp = mLightColor * tmp.y;
|
||||
Output.Diffuse = float4(tmp.x, tmp.y, tmp.z, 0);
|
||||
Output.TexCoord = texCoord;
|
||||
|
||||
return Output;
|
||||
}
|
||||
|
||||
|
||||
// Pixel shader output structure
|
||||
struct PS_OUTPUT
|
||||
{
|
||||
float4 RGBColor : COLOR0; // Pixel color
|
||||
};
|
||||
|
||||
|
||||
sampler2D myTexture;
|
||||
|
||||
PS_OUTPUT pixelMain(float2 TexCoord : TEXCOORD0,
|
||||
float4 Position : POSITION,
|
||||
float4 Diffuse : COLOR0 )
|
||||
{
|
||||
PS_OUTPUT Output;
|
||||
|
||||
float4 col = tex2D( myTexture, TexCoord ); // sample color map
|
||||
|
||||
// multiply with diffuse and do other senseless operations
|
||||
Output.RGBColor = Diffuse * col;
|
||||
Output.RGBColor *= 4.0;
|
||||
|
||||
return Output;
|
||||
}
|
||||
|
11
media/d3d9.psh
Normal file
@ -0,0 +1,11 @@
|
||||
; part of the Irrlicht Engine Shader example.
|
||||
; This simple Direct3D9 pixel shader will be loaded by the engine.
|
||||
; Please note that these example shaders don't do anything really useful.
|
||||
; They only demonstrate that shaders can be used in Irrlicht.
|
||||
|
||||
ps.1.1
|
||||
|
||||
tex t0 ; sample color map
|
||||
add r0, v0, v0 ; mulitply with color
|
||||
mul t0, t0, r0 ; mulitply with color
|
||||
add r0, t0, t0 ; make it brighter and store result
|
42
media/d3d9.vsh
Normal file
@ -0,0 +1,42 @@
|
||||
; part of the Irrlicht Engine Shader example.
|
||||
; This Direct3D9 vertex shader will be loaded by the engine.
|
||||
; Please note that these example shaders don't do anything really useful.
|
||||
; They only demonstrate that shaders can be used in Irrlicht.
|
||||
|
||||
vs.1.1
|
||||
|
||||
dcl_position v0; ; declare position
|
||||
dcl_normal v1; ; declare normal
|
||||
dcl_color v2; ; declare color
|
||||
dcl_texcoord0 v3; ; declare texture coordinate
|
||||
|
||||
; transpose and transform position to clip space
|
||||
mul r0, v0.x, c4
|
||||
mad r0, v0.y, c5, r0
|
||||
mad r0, v0.z, c6, r0
|
||||
add oPos, c7, r0
|
||||
|
||||
; transform normal
|
||||
dp3 r1.x, v1, c0
|
||||
dp3 r1.y, v1, c1
|
||||
dp3 r1.z, v1, c2
|
||||
|
||||
; renormalize normal
|
||||
dp3 r1.w, r1, r1
|
||||
rsq r1.w, r1.w
|
||||
mul r1, r1, r1.w
|
||||
|
||||
; calculate light vector
|
||||
m4x4 r6, v0, c10 ; vertex into world position
|
||||
add r2, c8, -r6 ; vtxpos - lightpos
|
||||
|
||||
; normalize light vector
|
||||
dp3 r2.w, r2, r2
|
||||
rsq r2.w, r2.w
|
||||
mul r2, r2, r2.w
|
||||
|
||||
; calculate light color
|
||||
dp3 r3, r1, r2 ; dp3 with negative light vector
|
||||
lit r5, r3 ; clamp to zero if r3 < 0, r5 has diffuce component in r5.y
|
||||
mul oD0, r5.y, c9 ; ouput diffuse color
|
||||
mov oT0, v3 ; store texture coordinates
|
BIN
media/demoback.jpg
Normal file
After Width: | Height: | Size: 95 KiB |
BIN
media/detailmap3.jpg
Normal file
After Width: | Height: | Size: 90 KiB |
BIN
media/directxlogo.png
Normal file
After Width: | Height: | Size: 9.7 KiB |
BIN
media/dotnetback.jpg
Normal file
After Width: | Height: | Size: 48 KiB |
51
media/dwarf-Read-Me.txt
Normal file
@ -0,0 +1,51 @@
|
||||
Dwarf lowpoly model Pack
|
||||
Copyright 2004, Psionic Design
|
||||
e-mail: psionic@blueyonder.co.uk
|
||||
|
||||
|
||||
|
||||
INSTALLATION INSTRUCTIONS:
|
||||
|
||||
To install, simply unzip to your hard drive with the "Use Folder Names" option turned on. And that's it you're ready to go!
|
||||
|
||||
|
||||
|
||||
USAGE INFORMATION:
|
||||
|
||||
Each zip contains the models, textures and animation info for that particular format!
|
||||
|
||||
Please Read the "animationinfo.txt" file included in each zip for the exact frames of animation to use
|
||||
|
||||
Credits to me "Psionic" are really appreciated but are not essential ;-)
|
||||
|
||||
Any questions, screenshots of him in use etc drop by my site or email me at:-
|
||||
|
||||
website: http://www.psionic3d.co.uk
|
||||
email: psionic@blueyonder.co.uk
|
||||
|
||||
|
||||
|
||||
|
||||
WHAT'S INCLUDED IN THE ZIP:
|
||||
|
||||
ReadMe.txt - This file
|
||||
b3d.zip - Blitz 3D Format models and textures
|
||||
ms3d.zip - Milkshape 3D Format models and textures
|
||||
x.zip - DarkBasic Direct X 8 Format models and textures
|
||||
|
||||
|
||||
|
||||
RESTRICTIONS:
|
||||
|
||||
This model pack is available for use in freeware, shareware, commercial games/software with the following restrictions:-
|
||||
|
||||
**You may not sell/re-sell this model pack or claim it as your own.
|
||||
***You may not redistribute this pack in some other model pack through a website or on a compilation CD of any kind, without my written consent.
|
||||
|
||||
|
||||
Psi
|
||||
http://www.psionic3d.co.uk
|
||||
|
||||
|
||||
|
||||
|
BIN
media/dwarf.jpg
Normal file
After Width: | Height: | Size: 82 KiB |
18468
media/dwarf.x
Normal file
BIN
media/earth.jpg
Normal file
After Width: | Height: | Size: 24 KiB |
20711
media/earth.x
Normal file
BIN
media/earthbump.jpg
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
media/enano.jpg
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
media/example.irr
Normal file
BIN
media/faerie.md2
Normal file
BIN
media/faerie2.bmp
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
media/fire.bmp
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
media/fireball.bmp
Normal file
After Width: | Height: | Size: 5.1 KiB |
BIN
media/fontcourier.bmp
Normal file
After Width: | Height: | Size: 192 KiB |
BIN
media/fonthaettenschweiler.bmp
Normal file
After Width: | Height: | Size: 192 KiB |
BIN
media/fontlucida.png
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
media/gun.jpg
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
media/gun.md2
Normal file
BIN
media/help.png
Normal file
After Width: | Height: | Size: 881 B |
BIN
media/icon_crosshairs16x16bw1.png
Normal file
After Width: | Height: | Size: 203 B |
BIN
media/icon_crosshairs16x16bw2.png
Normal file
After Width: | Height: | Size: 192 B |
BIN
media/icon_crosshairs16x16bw3.png
Normal file
After Width: | Height: | Size: 208 B |
BIN
media/icon_crosshairs16x16col.png
Normal file
After Width: | Height: | Size: 560 B |
BIN
media/iconlist.png
Normal file
After Width: | Height: | Size: 30 KiB |
BIN
media/impact.wav
Normal file
BIN
media/irr.ico
Normal file
After Width: | Height: | Size: 2.2 KiB |
BIN
media/irrlicht.dat
Normal file
BIN
media/irrlicht2_bk.jpg
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
media/irrlicht2_dn.jpg
Normal file
After Width: | Height: | Size: 61 KiB |
BIN
media/irrlicht2_ft.jpg
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
media/irrlicht2_lf.jpg
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
media/irrlicht2_rt.jpg
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
media/irrlicht2_up.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
media/irrlichtlogo.BMP
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
media/irrlichtlogo.jpg
Normal file
After Width: | Height: | Size: 2.5 KiB |
BIN
media/irrlichtlogo2.png
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
media/irrlichtlogo3.png
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
media/irrlichtlogoaligned.jpg
Normal file
After Width: | Height: | Size: 2.6 KiB |
BIN
media/irrlichtlogoalpha.tga
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
media/irrlichtlogoalpha2.tga
Normal file
BIN
media/lightFalloff.png
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
media/lucida.xml
Normal file
BIN
media/lucida0.png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
media/map-20kdm2.pk3
Normal file
50
media/map-20kdm2.txt
Normal file
@ -0,0 +1,50 @@
|
||||
|
||||
-=( Map Information )=- -----------------------------------------------
|
||||
|
||||
<Title> : Return to Castle: Quake
|
||||
<Date> : 02/02/02 - ren 11/17/2002
|
||||
<Filename> : map-20kdm2.pk3
|
||||
<Author> : Michael "<|3FG20K>" Cook
|
||||
<Email Address> : bfg20k@nycap.rr.com / bfg20k@planetquake.com
|
||||
<Website> : http://www.planetquake.com/bfg20k
|
||||
<Description> : This is an Evil7 Castle! It has three tiers,
|
||||
tight spaces, and plenty of room for various
|
||||
battles.
|
||||
|
||||
<Additional Credits> : [HFX]Evil, for making great textures.
|
||||
|
||||
-=( Construction )=- --------------------------------------------------
|
||||
|
||||
<Base> : None.
|
||||
<Editor(s) Used> : Q3Radiant - Build 202 & Q3Build
|
||||
<Known Bugs> : This isn't really a bug, but an added feature;
|
||||
you can walk on top of the battlements.
|
||||
<Construction Time> : 3 weeks.
|
||||
<Compile Machine> : 866mhz PIII, 512mb RAM
|
||||
|
||||
-=( Play Information )=- ----------------------------------------------
|
||||
|
||||
<Mod> : A good one.
|
||||
<Players> : 2-8 Players
|
||||
<Bots> : Duh! wait, I THINK they're smarter than Forrest
|
||||
Gump... You'll have to clarify that for me =).
|
||||
|
||||
-={ Installation }=- --------------------------------------------------
|
||||
|
||||
<Installation> : Unzip the the zip file map-20kdm2.zip into
|
||||
your "Quake III Arena\baseq3" directory
|
||||
Run Quake III Arena, and under console type
|
||||
"/map 20kdm2" or select under Skirmish in
|
||||
SIngle Player mode.
|
||||
|
||||
-=( Copyright / Permissions )=- ---------------------------------------
|
||||
|
||||
<Copyright> : You not include or distribute this map in any
|
||||
sort of commercial product without permission
|
||||
from the author. You may not mass distribute
|
||||
this level via any non-electronic means
|
||||
including but not limited to compact disks,
|
||||
and floppy disks without permission from the
|
||||
author.
|
||||
|
||||
-=( This is the End )=- -----------------------------------------------
|
36
media/ninja animation ranges.txt
Normal file
@ -0,0 +1,36 @@
|
||||
hey guys heres all the ranges for the ninja model, 20 ranges and 300 frames....Phew!!
|
||||
|
||||
you may need to scale or rotate the model and change animation speeds for various 3D game engines...
|
||||
|
||||
Please check the numbers carefully cus they dont follow any order and in between ranges often skip a few frames, this as how I achieved certain moves in Character FX its not a mistake :)
|
||||
|
||||
1-14 Walk (normal)
|
||||
15-30 Stealth Walk
|
||||
32-44 Punch and swipe sword
|
||||
45-59 Swipe and spin sword
|
||||
60-68 Overhead twohanded downswipe
|
||||
69-72 Up to block position (play backwards to lower sword if you want)
|
||||
73-83 Forward kick
|
||||
84-93 Pick up from floor (or down to crouch at frame 87)
|
||||
94-102 Jump
|
||||
103-111 Jump without height (for programmer controlled jumps)
|
||||
112-125 High jump to Sword Kill (Finish em off move??)
|
||||
126-133 Side Kick
|
||||
134-145 Spinning Sword attack (might wanna speed this up in game)
|
||||
146-158 Backflip
|
||||
159-165 Climb wall
|
||||
166-173 Death 1 - Fall back onto ground
|
||||
174-182 Death 2 - Fall forward onto ground
|
||||
184-205 Idle 1 - Breathe heavily
|
||||
206-250 Idle 2
|
||||
251-300 Idle 3
|
||||
|
||||
Ok there it is, have fun and maybe drop by my forums hang out, ask questions, post your own work etc
|
||||
|
||||
Feel free to use however you like, commercial etc, credits are Appreciated as a LOT of work went into this! ;-)
|
||||
|
||||
Psionic
|
||||
|
||||
http://www.psionic3d.co.uk
|
||||
|
||||
Note for Irrlicht: Irrlicht uses a 0-based frame index. So subtract 1 from each of the loops!
|
BIN
media/ninja.b3d
Normal file
BIN
media/nskinbl.jpg
Normal file
After Width: | Height: | Size: 39 KiB |
BIN
media/nskinrd.jpg
Normal file
After Width: | Height: | Size: 51 KiB |
BIN
media/open.png
Normal file
After Width: | Height: | Size: 904 B |
9
media/opengl.frag
Normal file
@ -0,0 +1,9 @@
|
||||
|
||||
uniform sampler2D myTexture;
|
||||
|
||||
void main (void)
|
||||
{
|
||||
vec4 col = texture2D(myTexture, vec2(gl_TexCoord[0]));
|
||||
col *= gl_Color;
|
||||
gl_FragColor = col * 4.0;
|
||||
}
|
22
media/opengl.psh
Normal file
@ -0,0 +1,22 @@
|
||||
!!ARBfp1.0
|
||||
# part of the Irrlicht Engine Shader example.
|
||||
# Please note that these example shaders don't do anything really useful.
|
||||
# They only demonstrate that shaders can be used in Irrlicht.
|
||||
|
||||
#Input
|
||||
ATTRIB inTexCoord = fragment.texcoord; # texture coordinates
|
||||
ATTRIB inColor = fragment.color.primary; # interpolated diffuse color
|
||||
|
||||
#Output
|
||||
OUTPUT outColor = result.color;
|
||||
|
||||
TEMP texelColor;
|
||||
TEMP tmp;
|
||||
TXP texelColor, inTexCoord, texture, 2D;
|
||||
|
||||
ADD tmp, inColor, inColor; # mulitply with color
|
||||
MUL texelColor, texelColor, tmp; # mulitply with color
|
||||
ADD outColor, texelColor, texelColor; # make it brighter and store result
|
||||
|
||||
END
|
||||
|
27
media/opengl.vert
Normal file
@ -0,0 +1,27 @@
|
||||
|
||||
uniform mat4 mWorldViewProj;
|
||||
uniform mat4 mInvWorld;
|
||||
uniform mat4 mTransWorld;
|
||||
uniform vec3 mLightPos;
|
||||
uniform vec4 mLightColor;
|
||||
|
||||
void main(void)
|
||||
{
|
||||
gl_Position = mWorldViewProj * gl_Vertex;
|
||||
|
||||
vec4 normal = vec4(gl_Normal, 0.0);
|
||||
normal = mInvWorld * normal;
|
||||
normal = normalize(normal);
|
||||
|
||||
vec4 worldpos = gl_Vertex * mTransWorld;
|
||||
|
||||
vec4 lightVector = worldpos - vec4(mLightPos,1.0);
|
||||
lightVector = normalize(lightVector);
|
||||
|
||||
float tmp2 = dot(-lightVector, normal);
|
||||
|
||||
vec4 tmp = mLightColor * tmp2;
|
||||
gl_FrontColor = gl_BackColor = vec4(tmp.x, tmp.y, tmp.z, 0.0);
|
||||
|
||||
gl_TexCoord[0] = gl_MultiTexCoord0;
|
||||
}
|
60
media/opengl.vsh
Normal file
@ -0,0 +1,60 @@
|
||||
!!ARBvp1.0
|
||||
# part of the Irrlicht Engine Shader example.
|
||||
# Please note that these example shaders don't do anything really useful.
|
||||
# They only demonstrate that shaders can be used in Irrlicht.
|
||||
|
||||
#input
|
||||
ATTRIB InPos = vertex.position;
|
||||
ATTRIB InColor = vertex.color;
|
||||
ATTRIB InNormal = vertex.normal;
|
||||
ATTRIB InTexCoord = vertex.texcoord;
|
||||
|
||||
#output
|
||||
OUTPUT OutPos = result.position;
|
||||
OUTPUT OutColor = result.color;
|
||||
OUTPUT OutTexCoord = result.texcoord;
|
||||
|
||||
PARAM MVP[4] = { state.matrix.mvp }; # modelViewProjection matrix.
|
||||
TEMP Temp;
|
||||
TEMP TempColor;
|
||||
TEMP TempNormal;
|
||||
TEMP TempPos;
|
||||
|
||||
#transform position to clip space
|
||||
DP4 Temp.x, MVP[0], InPos;
|
||||
DP4 Temp.y, MVP[1], InPos;
|
||||
DP4 Temp.z, MVP[2], InPos;
|
||||
DP4 Temp.w, MVP[3], InPos;
|
||||
|
||||
#transform normal
|
||||
DP3 TempNormal.x, InNormal.x, program.local[0];
|
||||
DP3 TempNormal.y, InNormal.y, program.local[1];
|
||||
DP3 TempNormal.z, InNormal.z, program.local[2];
|
||||
|
||||
#renormalize normal
|
||||
DP3 TempNormal.w, TempNormal, TempNormal;
|
||||
RSQ TempNormal.w, TempNormal.w;
|
||||
MUL TempNormal, TempNormal, TempNormal.w;
|
||||
|
||||
# calculate light vector
|
||||
DP4 TempPos.x, InPos, program.local[10]; # vertex into world position
|
||||
DP4 TempPos.y, InPos, program.local[11];
|
||||
DP4 TempPos.z, InPos, program.local[12];
|
||||
DP4 TempPos.w, InPos, program.local[13];
|
||||
|
||||
ADD TempPos, program.local[8], -TempPos; # vtxpos - lightpos
|
||||
|
||||
# normalize light vector
|
||||
DP3 TempPos.w, TempPos, TempPos;
|
||||
RSQ TempPos.w, TempPos.w;
|
||||
MUL TempPos, TempPos, TempPos.w;
|
||||
|
||||
# calculate light color
|
||||
DP3 TempColor, TempNormal, TempPos; # dp3 with negative light vector
|
||||
LIT OutColor, TempColor; # clamp to zero if r3 < 0, r5 has diffuce component in r5.y
|
||||
MUL OutColor, TempColor.y, program.local[9]; # ouput diffuse color
|
||||
MOV OutColor.w, 1.0; # we want alpha to be always 1
|
||||
MOV OutTexCoord, InTexCoord; # store texture coordinate
|
||||
MOV OutPos, Temp;
|
||||
|
||||
END
|
BIN
media/opengllogo.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
media/particle.bmp
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
media/particlegreen.jpg
Normal file
After Width: | Height: | Size: 21 KiB |