new files and images

7 views
Skip to first unread message

Gera Gundorov

unread,
Jun 8, 2008, 2:39:45 AM6/8/08
to FLASHOVER - Game Project
making a thread to announce and critique WIP loaded up in the files
section.

So far I got a few trees, and a start on one of the guards. The
engine does not support spec maps, so the tree snaps only have normal/
diffuse on them.

Praetor

unread,
Jun 12, 2008, 5:54:35 PM6/12/08
to FLASHOVER - Game Project
They look good, with the spec map thing do you mean that what you used
to render those shots doesn't support spec maps or that Torque
doesn't, because I'm fairly certain that it would be rather easy to
make a spec map shader (from what I've read Torque has good shader
support). For an fps project I'm working on I've made shaders for all
kinds of stuff like that (normal mapping, spec mapping, depth
shadowmapping, cubemapping, combinations thereof etc). I'd be happy to
adapt any of the shaders I have for my other project to flashover if
it'd help.

Gera Gundorov

unread,
Jun 15, 2008, 6:25:51 AM6/15/08
to FLASHOVER - Game Project
That would be amazing. I know little about shaders and you can
probably save us a ton of time with that.

Also, posting an illustration of the village (or what's left of it)
where the game would start. The house in the center shelters the
entrance to the cellar where Gael and Etienne are hiding out. The
idea is that the crusaders swept through the lands and just 'erased'
all the heretics on their path, so, being a smart bugger, Gael just
moved into the cellar of what used to be his house, living safely and
cautiously amongst the wreckage of the village. Still waiting on a
critique from my folks, so I might fix some minor things, but it is
done for the most part.

G

Dante

unread,
Jun 15, 2008, 1:56:37 PM6/15/08
to FLASHOVER - Game Project
Riley,

It is actually the Parallax shader in Torque that doesn't support spec
maps. You have to assign the specularity color and intensity in the
material script for each thing rendered with that shader. I'm not
exactly sure if spec maps could fully be used or not, I think they did
it that way so that it interacts correctly dynamically with the
lighting for the game. But a color/intensity map would be easier for
Gera instead of twiddling with the intensity #.

-Dante

Dante

unread,
Jun 15, 2008, 1:59:24 PM6/15/08
to FLASHOVER - Game Project
//-----------------------------------------------------------------------------
// Parallax Pixel Shader - For Garagegames TSE EA
// By: Jacob Dankovchik and Jevin Johnson
//-----------------------------------------------------------------------------
struct ConnectData
{
float2 texCoord : TEXCOORD0;
float2 bumpCoord : TEXCOORD1;
float3 lightVec : TEXCOORD2;
float3 tangenteye: TEXCOORD3;
float2 TEX1: TEXCOORD4;
};

struct Fragout
{
float4 col : COLOR0;
};

float2 ParallaxTexCoord(float2 oldcoord, sampler2D heightmap,
float3 eye_vect, float parallax_amount)
{
return (tex2D(heightmap, oldcoord)
* parallax_amount - parallax_amount * 0.5)
* eye_vect + oldcoord;
}

//-----------------------------------------------------------------------------
//
Main
//-----------------------------------------------------------------------------
Fragout main( ConnectData IN,
uniform sampler2D diffuseMap : register(S0),
uniform sampler2D bumpMap : register(S1),
uniform sampler2D height_map : register(S2),
uniform float4 ambient : register(C2),
uniform sampler2D lightMap : register(S3)
)
{
Fragout OUT;
float3 eyevect = normalize(IN.tangenteye);

float2 modified_texcoord = ParallaxTexCoord(IN.texCoord,
height_map, eyevect, 0.1);
OUT.col = tex2D(diffuseMap, modified_texcoord)* tex2D(lightMap,
IN.TEX1);
float4 bumpNormal = tex2D(bumpMap, modified_texcoord);

IN.lightVec = IN.lightVec * 2.0 - 1.0;
float4 bumpDot = saturate( dot(bumpNormal.xyz * 2.0 - 1.0,
IN.lightVec.xyz) );
OUT.col *= bumpDot + ambient;

return OUT;
}

Dante

unread,
Jun 15, 2008, 1:59:43 PM6/15/08
to FLASHOVER - Game Project
//-----------------------------------------------------------------------------
// Parallax Vertex Shader - For TSE EA
// By: Jacob Dankovchik and Jevin Johnson
//-----------------------------------------------------------------------------
struct VertData
{
float4 texCoord : TEXCOORD0;
float2 lmCoord : TEXCOORD1;
float3 T : TEXCOORD2;
float3 B : TEXCOORD3;
float3 normal : NORMAL;
float4 position : POSITION;
};


struct ConnectData
{
float4 hpos : POSITION;
float2 outTexCoord : TEXCOORD0;
float2 bumpCoord : TEXCOORD1;
float3 outLightVec : TEXCOORD2;
float3 tangenteye: TEXCOORD3;
float2 lightmap: TEXCOORD4;
};

//-----------------------------------------------------------------------------
//
Main
//-----------------------------------------------------------------------------
ConnectData main( VertData IN,
uniform float4x4 modelview : register(C0),
uniform float4x4 texMat : register(C4),
uniform float3 inLightVec : register(C24),
uniform float3 eyePos : register(C20),
uniform float4x4 objTrans : register(C12)
)
{
ConnectData OUT;

OUT.hpos = mul(modelview, IN.position);
OUT.outTexCoord = mul(texMat, IN.texCoord);
OUT.bumpCoord = OUT.outTexCoord;

float3x3 objToTangentSpace;
objToTangentSpace[0] = IN.T;
objToTangentSpace[1] = IN.B;
objToTangentSpace[2] = IN.normal;

OUT.outLightVec.xyz = -inLightVec;
OUT.outLightVec.xyz = mul(objToTangentSpace, OUT.outLightVec);
OUT.outLightVec = OUT.outLightVec / 2.0 + 0.5;
float3 objectspace_view_vector = mul( texMat, eyePos ) -
IN.position;
OUT.tangenteye = mul( objToTangentSpace,
objectspace_view_vector );
OUT.lightmap = IN.lmCoord;

return OUT;
}

Praetor

unread,
Jun 15, 2008, 3:58:55 PM6/15/08
to FLASHOVER - Game Project
I think that so long as the spec map uses the offset uv's just as the
diffuse map does then it should work, I'll see if I can modify that
shader to do so, or see if I have any that I can adapt. I'll post it
in a bit when I have something.

-Riley

On Jun 15, 10:59 am, Dante <dantefalc...@gmail.com> wrote:
> //-------------------------------------------------------------------------­----
> // Parallax Vertex Shader - For TSE EA
> // By: Jacob Dankovchik and Jevin Johnson
> //-------------------------------------------------------------------------­----
> struct VertData
> {
>    float4 texCoord        : TEXCOORD0;
>    float2 lmCoord         : TEXCOORD1;
>    float3 T               : TEXCOORD2;
>    float3 B               : TEXCOORD3;
>    float3 normal          : NORMAL;
>    float4 position        : POSITION;
>
> };
>
> struct ConnectData
> {
>    float4 hpos            : POSITION;
>    float2 outTexCoord     : TEXCOORD0;
>    float2 bumpCoord       : TEXCOORD1;
>    float3 outLightVec     : TEXCOORD2;
>    float3 tangenteye:   TEXCOORD3;
>    float2 lightmap:     TEXCOORD4;
>
> };
>
> //-------------------------------------------------------------------------­----
> //
> Main
> //-------------------------------------------------------------------------­----
> ConnectData main( VertData IN,
>                   uniform float4x4 modelview       : register(C0),
>                   uniform float4x4 texMat          : register(C4),
>                   uniform float3   inLightVec      : register(C24),
>                   uniform float3   eyePos          : register(C20),
>                   uniform float4x4 objTrans        : register(C12)
> )
> {
>    ConnectData OUT;
>
>    OUT.hpos = mul(modelview, IN.position);
>    OUT.outTexCoord = mul(texMat, IN.texCoord);
>    OUT.bumpCoord = OUT.outTexCoord;
>
>    float3x3 objToTangentSpace;
>    objToTangentSpace[0] = IN.T;
>    objToTangentSpace[1] = IN.B;
>    objToTangentSpace[2] = IN.normal;
>
>    OUT.outLightVec.xyz = -inLightVec;
>    OUT.outLightVec.xyz = mul(objToTangentSpace, OUT.outLightVec);
>    OUT.outLightVec = OUT.outLightVec / 2.0 + 0.5;
>    float3 objectspace_view_vector = mul( texMat, eyePos ) -
> IN.position;
>    OUT.tangenteye =  mul( objToTangentSpace,
> objectspace_view_vector );
>    OUT.lightmap = IN.lmCoord;
>
>    return OUT;
>
>
>
> }- Hide quoted text -
>
> - Show quoted text -

Praetor

unread,
Jun 15, 2008, 8:08:04 PM6/15/08
to FLASHOVER - Game Project
Okay here's the shader so far, in theory it should work, but I haven't
tested it yet and so there may be some mistake that I overlooked, it's
setup as if for Ogre, so it will likely need some slight changes for
use with Torque. If the formatting got messed up too much by the
forums wordwrapping, then I can post the hlsl file itself.

//Begin File

/////////////////////////////////////////////////////////////////////////
/== Parallax + SpecMap + LightMap Shader ==/
////////////////////////////////////////////////////////////////////////

void vertex_main
(
float4 position : POSITION,
float3 normal : NORMAL,
float2 uv : TEXCOORD0,
float2 uv2 : TEXCOORD1,
float3 tangent : TEXCOORD2,// judging by the example I assume
tangent and binormal are supplied here..?
float3 binormal : TEXCOORD3,

// Outputs
out float4 oPosition : POSITION,
out float2 oUv : TEXCOORD0,
out float2 oUv2 : TEXCOORD1,
out float3 oTSLightDir : TEXCOORD2, // (tangent space)
out float3 oTSHalfAngle : TEXCOORD3, // (tangent space)
out float3 oEyeDir : TEXCOORD4, // (tangent space)


//Apparently Torque requires registers for uniforms?
//I don't know how Torque wants that sort of thing setup so I've
left it blank

// uniform params, and the like
uniform float4x4 worldViewProj,

// object space:
uniform float4 lightPosition,
uniform float3 eyePosition
)
{
oPosition = mul(worldViewProj, position);

oUv = uv;
oUv2 = uv2;

float3 lightDir = normalize(lightPosition.xyz - (position *
lightPosition.w));

float3x3 rotation = float3x3(tangent, binormal, normal);

oTSLightDir = mul(rotation, lightDir);

float3 eyeDir = normalize(eyePosition - position.xyz);

float3 halfAngle = normalize(eyeDir + lightDir);

oTSHalfAngle = mul(rotation, halfAngle);

float3 eyeDir = eyePosition - position.xyz;

oEyeDir = normalize(mul(rotation, eyeDir));
}


float3 expand(float3 vect)
{
return (vect - 0.5) * 2;
}

void fragment_main
(
// inputs
float2 uv :TEXCOORD0,
float2 uv2 :TEXCOORD1,//lightmap coord
float3 TSLightDir :TEXCOORD2,
float3 TSHalfAngle :TEXCOORD3,
float3 eyeDir :TEXCOORD4,

// samplers, uniforms etc
//light stuff
uniform float3 diffuseColor, //Do the light maps include color?
uniform float3 specularColor,
uniform float3 ambientColor,
uniform float shininess, //Larger values result in brighter,
smaller highlights

uniform float2 scaleBias,//x component = scale, y = bias

// samplers
uniform sampler2D diffuseMap : register(S0),
uniform sampler2D normalMap : register(S1),
uniform sampler2D heightMap : register(S2),
uniform sampler2D lightMap : register(S3),
uniform sampler2D specMap : register(S4),

//output
out float4 oColor : COLOR)

)
{
// Using the alpha component of the normal or diffuse map would
also work here
float height = tex2D(heightMap, uv).r;

float scale = scaleBias.x;
float bias = scaleBias.y;

float displacement = (height * scale) + bias;

float3 uv3 = float3(uv, 1);

float2 offsetUV = ((eyeDir * displacement) + uv3).xy;

float3 normal = expand(tex2D(normalMap, offsetUV).xyz);
float3 diffuse = tex2D(diffuseMap, offsetUV).xyz;

float3 specular = pow(saturate(dot(normal, halfAngle)), shininess) *
specularColor;

// Spec map; allows for modifying color/intensity of the highlights
float3 specMap = tex2D(specMap,offsetUV);

float3 col = diffuse * saturate(dot(normal, TSLightDir)) *
diffuseColor + (specular*specMap);

//multiply in light map at the very end and add in ambient light
oColor = float4((col*tex2D(lightMap,uv2))+ambient, 1);

}

//End File
> > - Show quoted text -- Hide quoted text -

Gera Gundorov

unread,
Jun 19, 2008, 3:42:44 AM6/19/08
to FLASHOVER - Game Project
Finished guard1 bust (Zbrush only), 3 images posted. Unless someone
has any suggestions, I am moving on to the hands, then i will texture
the head and hands, then same steps for the clothes.

G

Gera Gundorov

unread,
Jun 22, 2008, 7:24:36 PM6/22/08
to FLASHOVER - Game Project
Guard1 hands are finished(Zbrush). Check it out.

G

Gera Gundorov

unread,
Jul 15, 2008, 9:10:41 PM7/15/08
to FLASHOVER - Game Project
How do we open these .rar's from the file section? We cant dl
them. Only images and text work there.

G

Dante Falcone

unread,
Jul 16, 2008, 1:45:09 AM7/16/08
to flasho...@googlegroups.com
Download them. Right click, save as. Use winRar to unzip them.

Dante

unread,
Jul 16, 2008, 1:45:56 AM7/16/08
to FLASHOVER - Game Project
Save them, right click, save as. Use winRar to unzip them.

Gera Gundorov

unread,
Jul 20, 2008, 4:46:12 PM7/20/08
to FLASHOVER - Game Project
Got it.
Reply all
Reply to author
Forward
0 new messages