Gamestudio Links
Zorro Links
Newest Posts
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
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 (AbrahamR), 717 guests, and 4 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 2 1 2
Toon Shader from Wiki #308946
02/05/10 23:18
02/05/10 23:18
Joined: Jan 2004
Posts: 439
G
Gamesaint762 Offline OP
Senior Member
Gamesaint762  Offline OP
Senior Member
G

Joined: Jan 2004
Posts: 439
When I add the simple toon shader from the Wiki i get this error on this first bit of code.

bmap bmp_normalizationcube=<normalize+6.tga>;
bmap bmp_toonlookup=<toonlookup.tga>;

the engine says, bmap undeclared identifier Anyone know how to fix this?

Re: Toon Shader from Wiki [Re: Gamesaint762] #308949
02/05/10 23:53
02/05/10 23:53
Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
Espér Offline
Expert
Espér  Offline
Expert

Joined: Mar 2008
Posts: 2,247
Baden Württemberg, Germany
rename it.. the wiki shaders have sometimes C Syntaxes...

bmap => BMAP*
<> => ""


Selling my Acknex Engine Editions (A7 Com & A8 Pro):
>> click here if you are interested <<
Re: Toon Shader from Wiki [Re: Espér] #308951
02/06/10 00:14
02/06/10 00:14
Joined: Jan 2004
Posts: 439
G
Gamesaint762 Offline OP
Senior Member
Gamesaint762  Offline OP
Senior Member
G

Joined: Jan 2004
Posts: 439
Ok thanks! Im not much of a scripter and Im trying to do some simple things to help out my coder. Art, gotta remember to stick to art...

Re: Toon Shader from Wiki [Re: Gamesaint762] #308953
02/06/10 00:27
02/06/10 00:27
Joined: Jan 2004
Posts: 439
G
Gamesaint762 Offline OP
Senior Member
Gamesaint762  Offline OP
Senior Member
G

Joined: Jan 2004
Posts: 439
I made the change, didnt seem to help... did this..

BMAP* bmp_normalizationcube= "normalize+6.tga";
BMAP* bmp_toonlookup= "toonlookup.tga";

AM I missing something? Please help!


Re: Toon Shader from Wiki [Re: Gamesaint762] #308956
02/06/10 00:31
02/06/10 00:31
Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany
Pappenheimer Offline
Senior Expert
Pappenheimer  Offline
Senior Expert

Joined: Sep 2003
Posts: 5,900
Bielefeld, Germany

BMAP* bmp_normalizationcube = "normalize+6.tga";
BMAP* bmp_toonlookup = "toonlookup.tga";

Re: Toon Shader from Wiki [Re: Pappenheimer] #308958
02/06/10 00:38
02/06/10 00:38
Joined: Jan 2004
Posts: 439
G
Gamesaint762 Offline OP
Senior Member
Gamesaint762  Offline OP
Senior Member
G

Joined: Jan 2004
Posts: 439
Ok Now this? Oh man I know why Im an animator now!

syntax error
< {
>

This all it says. Its referring to line 10 and I made the change from material mtl_toon to MATERIAL* mtl_toon

If anyone has the updated script I would love too see this...
Here it is straight from wiki...

Code:
bmap bmp_normalizationcube=<normalize+6.tga>;
bmap bmp_toonlookup=<toonlookup.tga>; 

function mtl_toon_init()
{
	bmap_to_cubemap(mtl.skin1);
}

material mtl_toon
{
	skin1=bmp_normalizationcube;
	skin2=bmp_toonlookup;
	event=mtl_toon_init;
	effect
	"
	texture entSkin1;
	texture mtlSkin1;
	texture mtlSkin2;
	matrix matWorldViewProj;
	matrix matWorld;
	vector vecSkill41;
	vector vecSunDir; 

	technique toon
	{
		//-------------------------------paint
		pass p0
		{
			texture[0]=<mtlSkin1>;
			texture[1]=<mtlSkin2>;
			texture[2]=<entSkin1>; 

			addressU[1]=clamp; 

			magFilter[2]=linear;
			minFilter[2]=linear;
			mipFilter[2]=linear;

			vertexShaderConstant[0]=<matWorldViewProj>;
			vertexShaderConstant[4]=<matWorld>; 

			vertexShaderConstant[16]=<vecSunDir>; 

			vertexShader=
			asm
			{
				vs.1.1
 		                dcl_position v0
				dcl_normal v3
				dcl_texcoord0 v7
				dcl_texcoord1 v8

				m4x4 oPos,v0,c0	  // transform position to clip space
				m3x3 r0,v3,c4	  // transform normal to world space
				dp3 r0.w,r0,r0	  // renormalize it
				rsq r0.w,r0.w
				mul r0,r0,r0.w
				mov oT0.xyz,r0.xyz  // output normal to oT0
				mov oT1.xyz,-c16    // output light direction to oT1
				mov oT2.xy,v7.xy    // output uvs to oT2
			};
			pixelShader=
			asm
			{
				ps.1.3
				tex t0		    // fetch normalized normal
				texdp3tex t1,t0_bx2 // light.normal=u -> use u to lookup in t1 
                                                   // _bx2 -> 0..1 of normcube will be   -1..1 
	 			tex t2		    // sample color map
				mul r0,t2,t1	    // modulate with shading
			};
		}
		//--------------------------------------------ink
		pass p1
		{
			cullMode=cw;
			vertexShaderConstant[0]=<matWorldViewProj>;
			vertexShaderConstant[16]=<vecSkill41>; // outline_thickness, 0, 0, 0
			vertexShader=
			asm
			{
				vs.1.1
				dcl_position v0
				dcl_normal v3
				dcl_texcoord0 v7
				dcl_texcoord1 v8

				mov r0,v0
				mul r1,c16.x,v3		  // scale normal
				add r0.xyz,r0.xyz,r1.xyz  // shell offset 
                                                         //(vertex position + scaled normal)
				m4x4 oPos,r0,c0		  // transform position to clip space
			};
			pixelShader=
			asm
			{
				ps.1.3
				def c0,0,0,0,1		  // outline rgba
 				mov r0,c0
 			};
 		}
 	}
	";
}

action toon
{
	my.skill41=float(0.8); // outline_thickness
	my.material=mtl_toon;
}



Re: Toon Shader from Wiki [Re: Gamesaint762] #308960
02/06/10 01:56
02/06/10 01:56
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Use the nice toon shader that comes with gamestudio (try it in shadertest.c with different values).

GS out *muahaha*


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Toon Shader from Wiki [Re: Superku] #309160
02/07/10 16:43
02/07/10 16:43
Joined: Jan 2004
Posts: 439
G
Gamesaint762 Offline OP
Senior Member
Gamesaint762  Offline OP
Senior Member
G

Joined: Jan 2004
Posts: 439
Ran shader.c and its very nice. How can I implement in game? Is this all just post processing or for models only?

Re: Toon Shader from Wiki [Re: Gamesaint762] #309166
02/07/10 17:17
02/07/10 17:17
Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Superku Offline
Senior Expert
Superku  Offline
Senior Expert

Joined: Sep 2003
Posts: 6,861
Kiel (Germany)
Depends on the shader. They are all implemented and ready to go in MtlFX.c (or how it is called) !


"Falls das Resultat nicht einfach nur dermassen gut aussieht, sollten Sie nochmal von vorn anfangen..." - Manual

Check out my new game: Pogostuck: Rage With Your Friends
Re: Toon Shader from Wiki [Re: Superku] #309177
02/07/10 18:18
02/07/10 18:18
Joined: Jan 2004
Posts: 439
G
Gamesaint762 Offline OP
Senior Member
Gamesaint762  Offline OP
Senior Member
G

Joined: Jan 2004
Posts: 439
I would like to just use the built in toon shader as a post processing effect. Has anyone done this? Is this possible? Please some more direction on this! Thanks!

Page 1 of 2 1 2

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