Tron effects :

Posted By: ratchet

Tron effects : - 01/20/13 12:43

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).
Posted By: MasterQ32

Re: Tron effects : - 01/20/13 12:46

you want some parts of the model to glow?
i could modify the default normalmapping shader to add glow effects if you want
Posted By: ratchet

Re: Tron effects : - 01/20/13 12:50

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
Posted By: MasterQ32

Re: Tron effects : - 01/20/13 13:27



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
Posted By: Aku_Aku

Re: Tron effects : - 01/20/13 13:43

Hey, your work is really simple and good!
Posted By: ratchet

Re: Tron effects : - 01/20/13 13:56

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.


Posted By: MasterQ32

Re: Tron effects : - 01/20/13 13:59

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
Posted By: ratchet

Re: Tron effects : - 01/20/13 14:23

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/
Posted By: MasterQ32

Re: Tron effects : - 01/20/13 14:24

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
Posted By: ratchet

Re: Tron effects : - 01/20/13 15:01

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 ...
Posted By: MasterQ32

Re: Tron effects : - 01/20/13 15:09

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
Posted By: ratchet

Re: Tron effects : - 01/20/13 20:18

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 ?
Posted By: MasterQ32

Re: Tron effects : - 01/20/13 20:29

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
Posted By: ratchet

Re: Tron effects : - 01/20/13 22:08

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
Posted By: 3run

Re: Tron effects : - 01/20/13 22:15

MasterQ32@ So, where is the glow effect???
Posted By: ratchet

Re: Tron effects : - 01/20/13 22:23

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 ??
Posted By: ratchet

Re: Tron effects : - 01/20/13 22:34

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
Posted By: txesmi

Re: Tron effects : - 01/20/13 23:03

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.
Posted By: txesmi

Re: Tron effects : - 01/21/13 13:25

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 );
}


Posted By: Kartoffel

Re: Tron effects : - 01/21/13 13:48

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.
Posted By: ratchet

Re: Tron effects : - 01/21/13 16:04

If you have some time only laugh
In fact i just need the Glow constant factor independant from sun light or amiant light.
If you can add some specular effect using the sunlight it wouldbe cool.
(caus normal map is not really needed, specially with very simple 3D models, once again if you have time whyt not also normal map!)

@txesmi :
I just tested your code, i don't see the difference ?
perhaps the glow effect is not strong enougth ?
Posted By: Kartoffel

Re: Tron effects : - 01/21/13 18:12

Okay a last question, do you want to use multiple colors for the glow effect or only one (limited per model)?
Posted By: txesmi

Re: Tron effects : - 01/21/13 18:48

Originally Posted By: ratchet
perhaps the glow effect is not strong enougth ?

Since is an addition, dark colors are not visible at all

Posted By: 3run

Re: Tron effects : - 01/21/13 20:29

Edit: I'm a bit disappointed... Model has only one skin set on.. and all that skin has is this:

No alpha channel or so... When I draw something on it, I can see the glow effect..
But how the hell model gets a texture, if it has only this one?? I'm confused.
Posted By: ratchet

Re: Tron effects : - 01/21/13 20:49

I don't know how bloom works ?
One colour would be great already.



Posted By: txesmi

Re: Tron effects : - 01/21/13 21:16

@3Run
it looks that your bitmap editor is occluding the color of the pixel because its alpha and showing a white background color.

Posted By: Kartoffel

Re: Tron effects : - 01/21/13 21:17

The way bloom works is easy:
- Make a "copy" of the rendered image
- Decrease brightness; Black parts won't be "bloomed", the brighter it is the more visible the bloom will be at the end
- Add blur to the image
- Mix the bloom image with the original image

There are some important steps missing such as downsampling, but in theory that's all.

And regarding the shader:
I'll do this tomorrow (and hopefully finish it tomorrow, too).

I thought about using the entity's red, green and blue values as glow color and using the skin's alpha channel as glow-intensity-map.

Maybe I'll also take some of my post-process shaders and combine them for you.
Probably a nice bloom shader and a zoom-blur effect ( looks nice for this kind of games wink )
Posted By: Kartoffel

Re: Tron effects : - 01/22/13 15:08

Okay this is what I've got so far:


In the screenshot I'm using my own post processing shaders with an intensive bloom.

Is this the result you're looking for?
Posted By: 3run

Re: Tron effects : - 01/22/13 15:11

Potato-Man, looks sweet, how you handle the glowing map? Second skin, or in alpha channel of the first one?
Posted By: Kartoffel

Re: Tron effects : - 01/22/13 15:18

Hi, nice that you like it laugh
I'm using the alpha channel of the first skin (inverted because then it is easier to take the skin and erase the glow-parts out instead of Messing around with 0% alpha on most of the skin.
Posted By: 3run

Re: Tron effects : - 01/22/13 15:21

OK, so for example, if I need some glowing splashes on the box, I need to pain those splashes on the texture, and then, make then black on the alpha channel?
Posted By: ratchet

Re: Tron effects : - 01/22/13 15:22

Wow laugh
that's it a real bloom effect.

I never seen that effect on any 3DGS project (or i simply missed them) !

I think it should be part of the next 3DGS official download laugh

It's so usefull for ancient magic, futurist things and levels or simply to make some retro glowing games.
Posted By: Kartoffel

Re: Tron effects : - 01/22/13 15:47

Originally Posted By: 3run
OK, so for example, if I need some glowing splashes on the box, I need to pain those splashes on the texture, and then, make then black on the alpha channel?

I'm not 100% sure what you mean but I think you understood it right grin

It's simple: full alpha = now glow, no alpha = max glow

in gimp for example I would create a new, transparent layer (which will be the glow mask), paint the parts which should be illuminated and the use selection from alpha.
Now you just have to select the base layer and hit 'del' to delete the selected parts. These will glow then laugh

Of course it is important that the file format supports alpha.

@ratchet thanks for the kind words smile
I'll try to make a simple (but similar) bloom-shader for you tongue
With this the glow effect should look nice.

Originally Posted By: ratchet
It's so usefull for ancient magic, futurist things and levels or simply to make some retro glowing games.
The main idea of bloom is using it on the whole scene, not just specific parts like glowing stripes wink
With this all bright areas of the screen will look bright - and this makes the whole scene seem more realistic.
For my bloom shader I tried to make the effect intensive and noticable but still smooth, so without having a brightness overkill grin
Posted By: 3run

Re: Tron effects : - 01/22/13 15:49

Nice man, are you going to share this? blush
Posted By: Kartoffel

Re: Tron effects : - 01/22/13 15:57

Originally Posted By: 3run
Nice man, are you going to share this? blush

the object shader?
yes, of course. That's why I created it.

my bloom shader?
yes, but that probably needs some time and it won't be 100% the same.
(the one I'm using is pretty complex, because it's using multiple bloom layers)

my pp-shader pipeline?
no.
I'm sorry but I just won't share the whole thing.
Posted By: 3run

Re: Tron effects : - 01/22/13 16:00

Originally Posted By: Kartoffel
my pp-shader pipeline?
no.
I'm sorry but I just won't share the whole thing.
No man, I don't need your whole pipeline grin And I don't need bloom as well, only the glow shader.
Posted By: Kartoffel

Re: Tron effects : - 01/22/13 16:48

okay, here you (two) go: download (~1.14 Mb)

...and what it includes / supports:
  • per pixel lighting, diffuse and specular (blinn-phong model)
  • all light types (directional- [sun], point- and spotlights)
  • normalmapping, 2nd skin is used as normalmap
  • some little stuff like overall-light-brightness and alpha-clip
  • ambient lighting; the material's and the entity's ambient values are added together
  • and the self illumination effect, of course; controlled by the alpha value as I've explained before

All the settings can be done by using the #defines in the shader file so have a look at it.
To disable normalmapping for example just comment the line: #define EnableNormalmapping

I also generated a quick normal-map to test it and for showing you the effect wink

At the moment it doesn't support fog I still have to do this, but for now this should be enough for you to start using the shader.
Posted By: 3run

Re: Tron effects : - 01/22/13 17:04

Thank you, I appreciate it.
Posted By: ratchet

Re: Tron effects : - 01/23/13 09:31

@Kartoffel:
Thanks a lot, that really kind, specially for the time you put on it laugh
The shader is not for me also, and i hope it to be in the official 3DGS shader library soon. I don't think i'm the only one that would like to use Glow on a game.

----------

I tested it, and it's good, but i don't see a lot the bloom factor , perhaps i will use it combined with a lot more Glowing one for special objects ?


On the image upper, as you can see on horizontal platforms you can run on them, the white rectangular parts are really glwoing a lot , perhaps it comes from a big Bloom effect on the scene ?

( I'll test your shader in some basic flat poly models to see how it runs already on a game scene )
Posted By: Kartoffel

Re: Tron effects : - 01/23/13 13:56

What I've uploaded is just the objectshader, no bloom.
It 'only' illuminates the glowing parts and adds no bloom effect to it.
Posted By: ratchet

Re: Tron effects : - 01/23/13 15:02

Ok, so i just have to add the HDR shader from 3DGS library ?
Posted By: Kartoffel

Re: Tron effects : - 01/23/13 15:12

Yes.
Or you wait some days and I'll create you some custom post process shaders with bloom if you want.
Posted By: ratchet

Re: Tron effects : - 01/23/13 15:30

Ok i just tried with HDR, but well it was not like in the game i put pictures.
Anyway adding , bloomBlur shader i have interesting effect, perhaps i'll use that for this special Retro simple game.

Don't put too much time in this shader if you have your own project already to manage laugh
Posted By: Kartoffel

Re: Tron effects : - 01/23/13 15:51

Originally Posted By: ratchet
Don't put too much time in this shader if you have your own project already to manage laugh

Well, my current "project" is a complete overhaul of my HDRR shader-pipeline, nothing too important.
...and it's actually fun to create custom shaders for other users grin

I think I'll do it on the weekend wink
Posted By: ratchet

Re: Tron effects : - 01/23/13 18:44

Take all your time , i'm involved in some projects other than 3D , so not so much time.
And try to make that little game on 3DGS, so this first shader is what i'll use to begin, if i reach some playable level laugh
Posted By: Kartoffel

Re: Tron effects : - 01/26/13 16:54

hey, I've got your post-processing shaders ready wink

it includes bloom, a zoom-blur effect ( I guess it's nice to have it, especially for the type of game you're working on laugh )
and some little features like a vignette effect

is there anything else I should add?
Posted By: ratchet

Re: Tron effects : - 01/26/13 19:01

is there anything else I should add?

You really alrady made an awesome addition to 3DGS with these glow shaders.
Just send us a download link one of these days when you'll have time i'll test it and perhaps other people also ?

Perhaps you could make some glowing shader that would need no alpah or Glow special maps ? (It would take the luminosity of the color by default)
This idea is lot more for some games based on 2D Sprites (or quad polygons with textures).
Posted By: Kartoffel

Re: Tron effects : - 01/26/13 19:05

Perhaps you could make some glowing shader that would need no alpah or Glow special maps ?

I'm sorry but I don't understand what you mean.
Where should the information about what has to be illuminated come from?

btw. is anybody else interested in this?
If so I'll upload it, create a new thread and give some how-to-use-information there.
Posted By: ratchet

Re: Tron effects : - 01/26/13 19:27

I mean for that style of game (not for me personnaly !) :
I htink it's perhaps some over Bloom effect ?
speaking of Bloom, 3DGS don't have any simple bloom full screen effect ? i don't have seen any on the shaders folder ?
Perhaps you could have fun making some bloom shader so, if you have some free time ?



Posted By: 3run

Re: Tron effects : - 01/26/13 19:43

Kartoffel@ I'm interested too, shaders are always useful laugh
Posted By: Kartoffel

Re: Tron effects : - 01/26/13 20:15

So you mean this neon-effect?

Well the purpose of bloom is: Bright parts bleed over dark parts.
And that's exactly what my shader does an what's beeing done in the screenshots you've posted (except the 1st one, I think this are simple 2d textures).

Let's take the last screen as example. ( love that game btw. laugh )
To get that effect simply use sprites and add a bloom shader with very low threshold.
That's all.
You probably need 3 Bloom passes to get that radius with a good quality but in theory that's all you have to do.

edit: as you can see it's possible (and easy)

I took the bloom shader and turned down the threshold.
( and I discovered that using pow on the alpha causes early bleeding which is perfect for a neon-effect laugh )
Posted By: ratchet

Re: Tron effects : - 01/26/13 21:01

Well good , so another bit of code you could share some time ?
(i talk about that bloom shader!)
Posted By: Kartoffel

Re: Tron effects : - 01/26/13 21:13

Sharing the shaders?
Well... the shader(s) you're seeing above are custom made for you, so, yes I think I'll share them with you tongue
Posted By: 3run

Re: Tron effects : - 01/26/13 21:51

Potato-Man@ so as I see, you are ignoring my post above.. very nice of you grin carry on
Posted By: Kartoffel

Re: Tron effects : - 01/26/13 21:53

So, at the moment the shaders still need some work, especially making them more userfriendly is important.
I think I'll finish this tomorrow.

Until then, some more screens laugh
(click on the image to see in original resolution)
Click to reveal..
no postprocessing:


postprocessing enabled:


zoom blur effect:


comparision between HDRR and non-HDRR (with hdrr color and brightness stay accurate resulting in much better visual quality)



EDIT: @3run, I didn't ignore you laugh
...and that I said I'll share the shaders with ratchet I didn't mean I'll only share them with him, sorry if you misunderstood this. smirk
If I'm finished I'll create a new thread so everyone who's interested can use it
Posted By: ratchet

Re: Tron effects : - 01/27/13 12:40

Amazing results laugh

Here is simple test i made (the scratches have been part of alpha by inadvertance :()


But i can begin the game now.

Iµ think this shader will help making graphic eye candy stuff with simple bitmaps or models.


I tried to put all code inside my main level code, but it bugs ?
Strange i put effect file, and the code of your main in some action ??

It seems my main don't see the effect file perhaps ? Straneg they are in same folder and my main have the import line ?

Posted By: Kartoffel

Re: Tron effects : - 01/27/13 13:04

Okay, I'll do some improvements in the next days but the shaders can already be used now.

You can download it here (~1.51 MB)

About the blur and the glow shader in general:
these shaders support HDRR, so you're not limited to the color range of 0 - 255. Use bright glow-colors to get a nice, bloomy effect.

Regarding the demo:
I've made 2 demos.
One showing the glow effect with the 2 cubes and one showing a neon-style effect (with graphics from the game 'GridWars')

have a look at 'main_cubes.c'.
In this file there's a lot of stuff explained and commented.

In the demos you can enable / disable the postprocessing with the p-key, move with wasd & mouse (hold right mouse
button to rotate the camera), use the zoom-blur effect by holding enter, and toggle the cubes rotation with the space-key.

EDIT: regarding your problem: it seems like the object is not using the shader.
Make sure you set the right material and .fx file
EDIT#2: in the example you uploaded the object-shader's file was called "glow.fx" or something like that. I chaged the name to "object.fx" maybe that's the problem
Posted By: ratchet

Re: Tron effects : - 01/27/13 13:21

I'll recheck my project.
Awesome work, a new 3DGS usefull shader is now possible.
Posted By: Kartoffel

Re: Tron effects : - 01/27/13 13:53

thanks laugh
looking forward to see some screens ( and gameplay, of course wink )
Posted By: 3run

Re: Tron effects : - 01/27/13 21:09

Few suggestions man:
* radial blur, should be able to find the center of the screen it's self (if we change during the run-time resolution, there is an offset).
* same for the HDRR I guess, cause I have a black line at the bottom of the screen, if I change the resolution, maybe I need to reload effects?

I use AMD, you maybe going to hate me for that grin Otherways, it looks really professional man! Could I ask you to add one simple post shader to the HDRR via PM (I need it for my current horror project)?
Posted By: ratchet

Re: Tron effects : - 01/27/13 21:33

and gameplay, of course

I have a problem with jumping code.
So i am seeing if i go for Physix solution and code if i can find it ?
Or do i keep C_trace and also will i find a good stable jumping code ?
Once this problem will be ok, gameplay will come !
Posted By: Kartoffel

Re: Tron effects : - 01/27/13 21:40

You still plan to make a game like the one you have posted a video of in the first post?

For this type of game I would suggest you to keep far away from PhysX. This will only make things harder.
A game like this doesn't need precise and ultra-realistic physics-interaction between objects.
Posted By: ratchet

Re: Tron effects : - 01/27/13 22:24

In fact i am in two projects now :

I keep the glow to make some similar game as the shooting picture, but with very different and diversified gameplay.

I think i'll make lot more simple models and stuff, but they will be lot more diversified and you'll have lot more gadgets and gameplay/ treasures.

------------------

The second i think it's always a run platform game, but i won't copy and won't go for Glow caus this type of game already exists.
The idea will be some sort of rock, wood platforms.
With several characters like in racing games, with each it's own specific speed,jump and special power effect.
Perhaps i'll put glow on some caves circuit or for some special Tron character bonus laugh
It will be PC game, but the goal is mobile platform.

Posted By: Kartoffel

Re: Tron effects : - 01/28/13 14:31

Originally Posted By: 3run
Few suggestions man:
* radial blur, should be able to find the center of the screen it's self (if we change during the run-time resolution, there is an offset).
* same for the HDRR I guess, cause I have a black line at the bottom of the screen, if I change the resolution, maybe I need to reload effects?

I use AMD, you maybe going to hate me for that grin Otherways, it looks really professional man! Could I ask you to add one simple post shader to the HDRR via PM (I need it for my current horror project)?

I somehow didn't see this post, sorry for that. ( or you've edited it smirk )

* radial blur, should be able to find the center of the screen it's self (if we change during the run-time resolution, there is an offset)
* same for the HDRR I guess, cause I have a black line at the bottom of the screen, if I change the resolution, maybe I need to reload effects?


The Blurshader uses a factor as coordinates, usually (0.5, 0.5) which is the center on every resolution.

...and it seems like you didn't read the discription in detail? tongue
Originally Posted By: main_cubes.c
PP_Run(); // Enables the PostProcessing-Pipeline (set your resolution before using this)
PP_Stop(); // Disables it again
PP_Renew(); // Renews the PostProcessing-Pipeline, do this after changing your resolution if the pp is already enabled

I use AMD, you maybe going to hate me for that grin
I'm using AMD aswell,
there's nothing wrong with it tongue

Otherways, it looks really professional man!
Thank you laugh

Could I ask you to add one simple post shader to the HDRR via PM (I need it for my current horror project)?
I'm not sure if I can manage to implement it but yeah, I'll try.
Posted By: ratchet

Re: Tron effects : - 01/28/13 15:19

I found that for you it could be usefull perhaps ?

Glow shaders

In the bottom of the page there is panels with a demo, the code of the shaders and a download fo the code laugh
Posted By: Kartoffel

Re: Tron effects : - 01/28/13 15:41

Thanks, but the shader is written in GLSL (OpenGL) - which is different from HLSL (DirectX)

Anyway, from what I can tell the shader is a simple bloom shader, nothing very special.
...I really don't wanna sound egomaniacal but I have to say the shaders that I gave you are a lot "better" tongue

EDIT: I just saw that there are other shaders shown, too (SSAO f.e.)
I guess I'll have a closer look at them laugh
Posted By: Kartoffel

Re: Tron effects : - 01/28/13 20:36

I made some improvements on the blending and the way how shader handles colors which are out of the visible range.

As you can see, the bright orange (~3x higher than the maximum visible brightness) blends over the dark model and creates a weird effect.
This has been fixed due to a new blending mode which also has a nicer color gradient:


After some more tests (and maybe some improvements) I will upload the newer version, I think in a new thread.
For this I will have to make it more user-friendly and I need to add a better explanation of the features and on how to use this stuff.
Posted By: ratchet

Re: Tron effects : - 01/28/13 21:16

So we will be able to adjust the shader to have first version or second version on your image ?

eher si some inspiration for your space game idea if you would go for that type of game : Strike Suit Zero on PC :














I stop , this game just looks awesome !
Posted By: Kartoffel

Re: Tron effects : - 01/28/13 21:33

Maaan nice screens grin

The shader will look like the second sphere, of course.
On the first one you see some ugly dark lines which are there because the bloom blending-mode couldn't handle very bright areas next to dark ones.
Posted By: ratchet

Re: Tron effects : - 01/29/13 10:01

Perhaps we chould choose the shader style we want ? why not ?
With dark ugly lines or not ?
---------------
Anyway , i played the game, it's really; for the planet it seems to be a SIMPLE skybox, and with very far effects on some transparent polygons : The result it's it works just great.

I perhaps i've played too much RPG games LOL laugh
caus when i playde this space game i felt a great joy controlling a ship and blasting things and the music, graphics , voices are great.
they put the minimum for character faces on screen for video transmission, but again it works just great.

I'm now motivated to make a space shooter or space RPG game lol laugh
( and that's lot lot more simple than a game with a character to animate indeed )
Posted By: Kartoffel

Re: Tron effects : - 01/29/13 14:07

Perhaps we chould choose the shader style we want ? why not ?
With dark ugly lines or not ?


I don't really know why?
The dark lines are not a feature. They are an unwanted and bad looking effect caused by the "old" blending mode.
Posted By: ratchet

Re: Tron effects : - 01/30/13 15:18

Yes, but in fact it makes some sort of new shaders laugh
Posted By: ratchet

Re: Tron effects : - 02/09/13 15:44

@Kartoffel :
Is your last shader update enought optimize if we could say in terms of speed ?
We can consider it as final and ready for projects ?
(personnaly i don't mind a lot and will use it as it works)
Posted By: Kartoffel

Re: Tron effects : - 02/09/13 16:56

Originally Posted By: ratchet
@Kartoffel :
Is your last shader update enought optimize if we could say in terms of speed ?
We can consider it as final and ready for projects ?
(personnaly i don't mind a lot and will use it as it works)

Yes it can already be used for projects and it's already optimized.

But I've got 7 free days ( no school grin ) and I'm going to make some final adjustments and efficiency optimizations in the next one or two days and I will make it more userfriendly.
Posted By: Cristiano_Iost

Re: Tron effects : - 09/26/13 21:30

This bloom shader works with .tga images ? How ?
© 2024 lite-C Forums