0 registered members (),
1,209
guests, and 0
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Tron effects :
#415554
01/20/13 12:43
01/20/13 12:43
|
Joined: Apr 2008
Posts: 2,488
ratchet
OP
Expert
|
OP
Expert
Joined: Apr 2008
Posts: 2,488
|
Hi ! I would want to have some shader(s) doing that effect with 3DGS : indie game video Anyone have some ideas ? I mean the glow effect (not the motion blurr).
|
|
|
Re: Tron effects :
[Re: MasterQ32]
#415556
01/20/13 12:50
01/20/13 12:50
|
Joined: Apr 2008
Posts: 2,488
ratchet
OP
Expert
|
OP
Expert
Joined: Apr 2008
Posts: 2,488
|
In fact texture parts (with some alpha no ?) ? It seems it's like that that it works, use the alpha or second texture for indicating glowing parts ? Anyway, if you hav time to make a quick test with some other Glowing effect, i'm interested
|
|
|
Re: Tron effects :
[Re: ratchet]
#415558
01/20/13 13:27
01/20/13 13:27
|
Joined: Nov 2007
Posts: 2,568 Germany, BW, Stuttgart
MasterQ32
Expert
|
Expert
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
|
#include <acknex.h>
#include <default.c>
#include <mtlFx.c>
MATERIAL *matGlow =
{
effect = "glownm.fx";
ambient_red = 16;
ambient_green = 16;
ambient_blue = 16;
flags = PASS_SOLID | AUTORELOAD;
}
function main()
{
level_load(NULL);
you = ent_create("techcont_5.mdl", vector(128, -64, 0), NULL);
you->material = matGlow;
}
#include <define>
#include <transform>
#include <sun>
#include <lights>
#include <fog>
#include <normal>
Texture entSkin1; // Color
float4 vecSkill41;
float4 vecAmbient;
sampler sColor = sampler_state { Texture = <entSkin1>; MipFilter = Linear; };
//////////////////////////////////////////////////////////////////////
struct out_terraintex3 // Output to the pixelshader fragment
{
float4 Pos : POSITION;
float4 Color : COLOR0;
float Fog : FOG;
float2 TexCoord : TEXCOORD0;
};
out_terraintex3 vs_terraintex3(
float4 inPos : POSITION,
float3 inNormal : NORMAL,
float2 inTexCoord0 : TEXCOORD0)
{
out_terraintex3 Out;
Out.Pos = DoTransform(inPos); // transform to screen coordinates
// rotate and normalize the normal
float3 N = DoNormal(inNormal);
float3 P = mul(inPos,matWorld);
Out.Color = vecAmbient; // Add ambient and sun light
for (int i=0; i<8; i++) // Add 8 dynamic lights
Out.Color += DoLight(P,N,i);
Out.Fog = DoFog(inPos); // Add fog
// scale the texture coordinates for the masked textures
Out.TexCoord = inTexCoord0.xy;
return Out;
}
float4 ps_terraintex3(out_terraintex3 In): COLOR
{
float4 Color = tex2D(sColor,In.TexCoord);
Color = Color * In.Color + Color * Color.a;
Color.a = 1.0f; // prevent transparency
return Color;
}
technique terraintex3_13
{
pass one
{
sampler[0] = (sColor);
ZWriteEnable = true;
ZEnable = true;
ZFunc = Less;
AlphaBlendEnable = false;
FillMode = Solid;
CullMode = CCW;
VertexShader = compile vs_2_0 vs_terraintex3();
PixelShader = compile ps_2_0 ps_terraintex3();
}
}
// fallback if nothing works
technique fallback { pass one { } }
Texture file: I know it's not the best one but it works maybe you can get much more out of it if you use better textures and models
|
|
|
Re: Tron effects :
[Re: Aku_Aku]
#415563
01/20/13 13:56
01/20/13 13:56
|
Joined: Apr 2008
Posts: 2,488
ratchet
OP
Expert
|
OP
Expert
Joined: Apr 2008
Posts: 2,488
|
wow , tanks a lot MasterQ32 ! We don't see the effect a lot, i think it's because of blue background and textures you used ; i'll gonna try it right now That's strange your code takls about terrain and lights ? And where do i put the shader code ? Arrrghhhhh .... The day 3DGS will evolve a bit more instead of beeing so prehistoric, and allow direct integration of shader code without coding , drag and drop and menu select for shaders .... One of the many reasons it is hard for 3D artists to go for 3DGS.
Last edited by ratchet; 01/20/13 14:21.
|
|
|
Re: Tron effects :
[Re: MasterQ32]
#415568
01/20/13 14:23
01/20/13 14:23
|
Joined: Apr 2008
Posts: 2,488
ratchet
OP
Expert
|
OP
Expert
Joined: Apr 2008
Posts: 2,488
|
lol i don't understand anything ... ahahaha a 3D artist talking to a sdare programmer. Could you put the example on some sharing site ? http://www.2shared.com/
Last edited by ratchet; 01/20/13 14:24.
|
|
|
Re: Tron effects :
[Re: MasterQ32]
#415571
01/20/13 15:01
01/20/13 15:01
|
Joined: Apr 2008
Posts: 2,488
ratchet
OP
Expert
|
OP
Expert
Joined: Apr 2008
Posts: 2,488
|
Not sure it will be optimized ?? Well i tested on a model, afetr putting the file, and i got a BLack Screen ?? So my decision : take some engine having natively that shader ? or simply used 3DGS and official shaders ... It's for the little contest so i keep 3DGS and normal map/specular shader instead ...
|
|
|
|