Gamestudio Links
Zorro Links
Newest Posts
Zorro 2.70
by jcl. 09/29/25 09:24
optimize global parameters SOLVED
by dBc. 09/27/25 17:07
ZorroGPT
by TipmyPip. 09/27/25 10:05
assetHistory one candle shift
by jcl. 09/21/25 11:36
Plugins update
by Grant. 09/17/25 16:28
AUM Magazine
Latest Screens
Rocker`s Revenge
Stug 3 Stormartillery
Iljuschin 2
Galactic Strike X
Who's Online Now
1 registered members (TipmyPip), 18,388 guests, and 6 spiders.
Key: Admin, Global Mod, Mod
Newest Members
krishna, DrissB, James168, Ed_Love, xtns
19168 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 2 1 2
Re: Toon shader & fog colors? [Re: Hummel] #373898
06/13/11 23:29
06/13/11 23:29
Joined: Apr 2011
Posts: 67
Balkan
Pavle Offline OP
Junior Member
Pavle  Offline OP
Junior Member

Joined: Apr 2011
Posts: 67
Balkan
This also doesn't seem to work, unless the nofog is checked on a model the outlining color is still the same as the active fog color:(

I made a few tests, it looks like the code is working when level is compiled with GS version7.84 but not with GS version 7.50. Is there any way I can reproduce the same effect with 7.50? I tried replacing default.fx from 7.50 with the one from 7.84 by putting it in the same folder as the level but the effect was the same.


Last edited by Pavle; 06/13/11 23:52.

>>Demos free3DModels Tutorials<<
>>>>>>> by Pavle Nikolic <<<<<<<
Re: Toon shader & fog colors? [Re: Pavle] #373899
06/13/11 23:51
06/13/11 23:51
Joined: Mar 2006
Posts: 2,252
Hummel Offline
Expert
Hummel  Offline
Expert

Joined: Mar 2006
Posts: 2,252
still strange, try this:
Click to reveal..


void PS_Outline(
out float4 COL :COLOR0
)
{
COL=float4(0,0,0,1);
}


technique toon
{
pass one
{
VertexShader = compile vs_1_1 toonVS();
PixelShader = compile ps_1_4 toonPS();
}
pass two
{
CULLMODE=CW;
vertexShaderConstant[0] = <matWorldViewProj>;
vertexShaderConstant[16] = <vecSkill41.y/20.>;

VertexShader = asm
{
vs_1_0
dcl_position v0
dcl_normal v3
dcl_texcoord v7
mov r0,v0
mul r1,c16.x,v3
// Scale the normal
add r0.xyz,r0.xyz,r1.xyz
m4x4 oPos,r0,c0
// Transorm position to clip space
mov oD0, c0
mov r0,c0
};

PixelShader = compile ps_2_0 PS_Outline();
}
}


What graphics card do you have and did you try to update your drivers?

Re: Toon shader & fog colors? [Re: Hummel] #373900
06/14/11 00:02
06/14/11 00:02
Joined: Apr 2011
Posts: 67
Balkan
Pavle Offline OP
Junior Member
Pavle  Offline OP
Junior Member

Joined: Apr 2011
Posts: 67
Balkan
Yes, I've tested it10 times now, the code is working fine but only in (I have commercial) versions above 7.50:( I also tried to put default.fx from free version 8.10 but nothing:(


>>Demos free3DModels Tutorials<<
>>>>>>> by Pavle Nikolic <<<<<<<
Re: Toon shader & fog colors? [Re: Pavle] #373902
06/14/11 00:17
06/14/11 00:17
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
I am not at all into shader asm, but I am very sure that somewhere the fog register is assigned a value. Also, there is no shadermodel below 1.4 (or was it 2.0?) with gamestudios directx version anymore.
Just rewrite the vertexshader in hlsl and it should work.

Re: Toon shader & fog colors? [Re: Slin] #373910
06/14/11 03:39
06/14/11 03:39
Joined: Aug 2008
Posts: 482
B
bart_the_13th Offline
Senior Member
bart_the_13th  Offline
Senior Member
B

Joined: Aug 2008
Posts: 482
I forgot how I did it on RedHood .It's been a long time since I touch asm shader, but I think that there is a command to enable/disable fog, FOGENABLE = FALSE, maybe?

Re: Toon shader & fog colors? [Re: bart_the_13th] #373993
06/14/11 19:03
06/14/11 19:03
Joined: Apr 2011
Posts: 67
Balkan
Pavle Offline OP
Junior Member
Pavle  Offline OP
Junior Member

Joined: Apr 2011
Posts: 67
Balkan
@Hummel
Thanx for your help, I really appreciate it:)

@Slin
Unfortunately, although it does sounds like a good idea, I never done rewriting of shaders in hlsl, it may be a bit too advanced for me:) I will try experimenting with your line of code also now that I know that some of the things do work in 7.84 but not in 7.50.

@Bart the 13th
The color of outlining is now, with the Hummel's modifications, solid black when I check nofog on a model. The problem is that I use fog in the levels & need models to be influenced by the fog's density but not fog's color.


>>Demos free3DModels Tutorials<<
>>>>>>> by Pavle Nikolic <<<<<<<
Re: Toon shader & fog colors? [Re: Pavle] #373994
06/14/11 19:08
06/14/11 19:08
Joined: May 2005
Posts: 2,713
Lübeck
Slin Offline
Expert
Slin  Offline
Expert

Joined: May 2005
Posts: 2,713
Lübeck
Originally Posted By: Pavle
@Hummel
@Bart the 13th
The color of outlining is now, with the Hummel's modifications, solid black when I check nofog on a model. The problem is that I use fog in the levels & need models to be influenced by the fog's density but not fog's color.


I think he means this:
Code:
void PS_Outline(
out float4 COL :COLOR0
)
{
COL=float4(0,0,0,1);
}


technique toon
{
pass one
{
VertexShader = compile vs_1_1 toonVS();
PixelShader = compile ps_1_4 toonPS();
}
pass two
{
CullMode = CW;
FogEnable = false;
vertexShaderConstant[0] = <matWorldViewProj>;
vertexShaderConstant[16] = <vecSkill41.y/20.>;

VertexShader = asm
{
vs_1_0
dcl_position v0
dcl_normal v3
dcl_texcoord v7
mov r0,v0
mul r1,c16.x,v3
// Scale the normal
add r0.xyz,r0.xyz,r1.xyz
m4x4 oPos,r0,c0
// Transorm position to clip space
mov oD0, c0
mov r0,c0
};

PixelShader = compile ps_2_0 PS_Outline();
}
}



Re: Toon shader & fog colors? [Re: Slin] #374003
06/14/11 19:54
06/14/11 19:54
Joined: Apr 2011
Posts: 67
Balkan
Pavle Offline OP
Junior Member
Pavle  Offline OP
Junior Member

Joined: Apr 2011
Posts: 67
Balkan
Yeah this is it, the model is being influenced by the color/density of the fog but the outlining is still black:) This is what I was looking for & it all works even in GS version 7.50, thanx for helping out:)


>>Demos free3DModels Tutorials<<
>>>>>>> by Pavle Nikolic <<<<<<<
Page 2 of 2 1 2

Moderated by  Blink, Hummel, Superku 

Gamestudio download | 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