Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (AndrewAMD), 959 guests, and 8 spiders.
Key: Admin, Global Mod, Mod
Newest Members
firatv, wandaluciaia, Mega_Rod, EternallyCurious, howardR
19050 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 8 1 2 3 4 5 6 7 8
Re: Tron effects : [Re: ratchet] #415575
01/20/13 15:09
01/20/13 15:09
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
have you take a look at my demo code?
just assign the matGlow to your model
and create a file called glownm.fx with the shader code in it
that's all

the alpha value gives you a glow factor
alpha = 0: no glow
alpha = 255: full glow


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

Joined: Apr 2008
Posts: 2,488
I created the file you said , in the folder of 3DGS containing all material files , or should i create the material fiel on the project folder ?
I created an action that just assign the new material to nay 3D model, and put this action to a model i put on the level : black screen.

Well you could just upload your ziped project to the link i put no ?

Re: Tron effects : [Re: ratchet] #415589
01/20/13 20:29
01/20/13 20:29
Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
MasterQ32 Offline
Expert
MasterQ32  Offline
Expert

Joined: Nov 2007
Posts: 2,568
Germany, BW, Stuttgart
black screen sounds like you forgot to load your level at all in the script ^^
here you go:
http://h1946903.stratoserver.net/Bilder/glow.zip


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

Joined: Apr 2008
Posts: 2,488
In fact i redone the level and tried all one time again and used your models.
In fact the material file you've done must be place in the project folder also.

Thanks for the material, i htink i'll find a use of it , even if it is some sort of self illuination !

But for that case i work on i really needed : REAL GLOW laugh
I mean GLOWING STUFF :
like this one :
example code

Last edited by ratchet; 01/20/13 22:08.
Re: Tron effects : [Re: ratchet] #415595
01/20/13 22:15
01/20/13 22:15
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
MasterQ32@ So, where is the glow effect???


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Tron effects : [Re: 3run] #415596
01/20/13 22:23
01/20/13 22:23
Joined: Apr 2008
Posts: 2,488
ratchet Offline OP
Expert
ratchet  Offline OP
Expert

Joined: Apr 2008
Posts: 2,488
I think you mix self illumination and Glow efffect laugh
Glow is somewhat like some slef illumination + bloom effect.

Anyway i have made a better example for your shader :
YEs this is self illumination, perhaps adding some bloom on full scene i had some glow ??

Re: Tron effects : [Re: ratchet] #415597
01/20/13 22:34
01/20/13 22:34
Joined: Apr 2008
Posts: 2,488
ratchet Offline OP
Expert
ratchet  Offline OP
Expert

Joined: Apr 2008
Posts: 2,488
Well your illumination shader do some Glow if i add HDR to the scene :

The problem it doesn't work on non illuminated 3D faces as you can see.
Because it's just the HDR effect taking on illuminated parts, not a real bloom frown

Last edited by ratchet; 01/20/13 22:36.
Re: Tron effects : [Re: ratchet] #415600
01/20/13 23:03
01/20/13 23:03
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
I would render a low resolution glow color mask in a secondary view and mix it by a blur technique in a postprocess. Surelly in the case that the effect is as present as in the video of the topic.

Re: Tron effects : [Re: txesmi] #415631
01/21/13 13:25
01/21/13 13:25
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
double post, interesting info.

Here is a quick working example:
Click to reveal..

Code:
#include <acknex.h>
#include <default.c>

VIEW *camGlow;
VIEW *camMix;
BMAP *bmpGlow;
BMAP *bmpCamera;

MATERIAL *mtlObject =
{
	effect =	"
		float4x4 matWorldViewProj;
		
		Texture entSkin1;
		sampler entSkin1Sampler = sampler_state { Texture = <entSkin1>; MipFilter = Linear; };
		
		void VS (
			in float4 inPos : POSITION,
			in float2 inTex : TEXCOORD0,
			out float4 outPos : POSITION,
			out float2 outTex : TEXCOORD0 )
			{
				outPos = mul ( inPos, matWorldViewProj );
				outTex = inTex;
			}
		
		float4 PS ( in float2 inTex : TEXCOORD0 ): COLOR0
		{
			float4 Color = tex2D ( entSkin1Sampler, inTex );
			Color.a = 1.0f;
			return Color;
		}
		
		
		technique Solid
		{
			pass one
			{
				ZWriteEnable = true;
				AlphaBlendEnable = true;
				
				VertexShader = compile vs_2_0 VS ();
				PixelShader = compile ps_2_0 PS ();
			}
		}
	";
	
	flags = PASS_SOLID;
}

MATERIAL *mtlGlow =
{
	effect = "
		float4x4 matWorldViewProj;
		
		Texture entSkin1;
		sampler entSkin1Sampler = sampler_state { Texture = <entSkin1>; MipFilter = Linear; };
		
		void VS(
			in float4 inPos : POSITION,
			in float2 inTex : TEXCOORD0,
			out float4 outPosition : POSITION,
			out float2 outTex : TEXCOORD0 )
			{
				outPosition = mul ( inPos, matWorldViewProj );
				outTex = inTex;
			}
		
		float4 PS ( in float2 inTex : TEXCOORD0 ): COLOR
		{
			float4 Color = tex2D ( entSkin1Sampler, inTex );
			Color.rgb = lerp ( 0, Color.rgb, Color.a );
			Color.a = 1;
			return Color;
		}
		
		
		technique Glow
		{
			pass one
			{
				ZWriteEnable = true;
				AlphaBlendEnable = false;
				
				VertexShader = compile vs_2_0 VS ();
				PixelShader = compile ps_2_0 PS ();
			}
		}
		
		technique fallback { pass one { } }
	";
}

MATERIAL *mtlMix =
{
	effect = "
		float4 vecViewPort;
		float4 vecSkill1;
		
		static const float fWeights[4] = 
		{
		    0.133333,
		    0.066666,
		    0.033333,
		    0.016666
		};
		
		Texture TargetMap;
		Texture mtlSkin1;
		sampler ColorSampler = sampler_state { Texture = <mtlSkin1>; MipFilter = Linear; };
		sampler GlowSampler = sampler_state { Texture = <TargetMap>; MipFilter = Linear; AddressU=Clamp; AddressV=Clamp; };
		
		float4 PS ( in float2 inTex : TEXCOORD0 ): COLOR
		{
			float2 Coord = inTex * vecSkill1.xy;
			float4 Color = tex2D ( ColorSampler, Coord );
			
			float3 Glow = 0.0f;
			float2 vOffset = vecViewPort.zw * 2;
			for ( int i=1; i<5; i++ )
			{
				float3 Glow2 = tex2D ( GlowSampler, Coord + vOffset * i ).rgb;
				Glow2.rgb += tex2D ( GlowSampler, Coord - vOffset * i ).rgb;
				vOffset.x = -vOffset.x;
				Glow2.rgb += tex2D ( GlowSampler, Coord + vOffset * i ).rgb;
				Glow2.rgb += tex2D ( GlowSampler, Coord - vOffset * i ).rgb;
				vOffset.x = -vOffset.x;
				
				Glow.rgb += Glow2.rgb * fWeights[i-1];
			}		
			
			Color.rgb += Glow.rgb;
			
			return Color;
		}
		
		
		technique Mix
		{
			pass one
			{
				AlphaBlendEnable = false;
				
				VertexShader = null;
				PixelShader = compile ps_2_0 PS ();
			}
		}
	";
}

function main ()
{
	wait(1);
	level_load ( "" );
	
	you = ent_create("techcont_5.mdl", vector(128, 0, -32), NULL);
	you.material = mtlObject;
	
	bmpCamera = bmap_createblack ( screen_size.x, screen_size.y, 24 );
	bmpGlow = bmap_createblack ( screen_size.x*0.25, screen_size.y*0.25, 24 );
	
	mtlMix.skill1 = floatv ( 0.25 );
	mtlMix.skill2 = floatv ( 0.25 );
	mtlMix.skin1 = bmpCamera;
	
	camMix = view_create ( 1 );
	camMix.material = mtlMix;
	set ( camMix, PROCESS_TARGET );
	
	camGlow = view_create ( 1 );
	camGlow.bmap = bmpGlow;
	camGlow.material = mtlGlow;
	set ( camGlow, CHILD );
	
	camera.bg = pixel_for_vec ( nullvector, 100, 8888 );
	camera.bmap = bmpCamera;
	
	camera.stage = camGlow;
	camGlow.stage = camMix;
	
	while ( !key_esc )
	{
		DEBUG_BMAP ( bmpCamera, 0, 0.125 );
		DEBUG_BMAP ( bmpGlow, 130, 0.5 );
		wait (1);
	}
	
	sys_exit ( NULL );
}



Re: Tron effects : [Re: ratchet] #415634
01/21/13 13:48
01/21/13 13:48
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Originally Posted By: ratchet
The problem it doesn't work on non illuminated 3D faces as you can see.
Because it's just the HDR effect taking on illuminated parts, not a real bloom frown

The "problem" is that the sunlight is adding even more brightness to the "glowing" parts which makes them bright enough to affect the bloom shader.

If you want to I can create an object shader with all the stuff you need (also lighting / normalmapping).
Let me know if you're interested.

Last edited by Kartoffel; 01/21/13 13:54.

POTATO-MAN saves the day! - Random
Page 2 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