Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (TedMar), 1,420 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 8 1 2 3 4 5 6 7 8
Tron effects : #415554
01/20/13 12:43
01/20/13 12:43
Joined: Apr 2008
Posts: 2,488
ratchet Offline OP
Expert
ratchet  Offline 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: ratchet] #415555
01/20/13 12:46
01/20/13 12:46
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
you want some parts of the model to glow?
i could modify the default normalmapping shader to add glow effects if you want


Visit my site: www.masterq32.de
Re: Tron effects : [Re: MasterQ32] #415556
01/20/13 12:50
01/20/13 12:50
Joined: Apr 2008
Posts: 2,488
ratchet Offline OP
Expert
ratchet  Offline 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 laugh

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 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart


Click to reveal..

Code:
#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;
}


Code:
#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 wink


Visit my site: www.masterq32.de
Re: Tron effects : [Re: MasterQ32] #415559
01/20/13 13:43
01/20/13 13:43
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline
User
Aku_Aku  Offline
User

Joined: Sep 2009
Posts: 993
Budapest
Hey, your work is really simple and good!

Re: Tron effects : [Re: Aku_Aku] #415563
01/20/13 13:56
01/20/13 13:56
Joined: Apr 2008
Posts: 2,488
ratchet Offline OP
Expert
ratchet  Offline 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 laugh

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: ratchet] #415564
01/20/13 13:59
01/20/13 13:59
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
this is actualle the terraintex3 shader grin grin
also just compare the left side with the right side of the cube
it's all darker but the red parts


Visit my site: www.masterq32.de
Re: Tron effects : [Re: MasterQ32] #415568
01/20/13 14:23
01/20/13 14:23
Joined: Apr 2008
Posts: 2,488
ratchet Offline OP
Expert
ratchet  Offline OP
Expert

Joined: Apr 2008
Posts: 2,488
lol
i don't understand anything ... ahahaha laugh
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: ratchet] #415569
01/20/13 14:24
01/20/13 14:24
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
just put the shadercode into a file named glownm.fx
and yeah, the code is quick and dirty copy of terraintex3.fx as a codebase grin
just ignore this


Visit my site: www.masterq32.de
Re: Tron effects : [Re: MasterQ32] #415571
01/20/13 15:01
01/20/13 15:01
Joined: Apr 2008
Posts: 2,488
ratchet Offline OP
Expert
ratchet  Offline OP
Expert

Joined: Apr 2008
Posts: 2,488
Not sure it will be optimized ?? laugh
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 ...

Page 1 of 8 1 2 3 4 5 6 7 8

Moderated by  Blink, Hummel, Superku 

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