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
2 registered members (Ayumi, 1 invisible), 584 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Toon shader distance scale #204633
04/30/08 12:01
04/30/08 12:01
Joined: Feb 2006
Posts: 616
Netherlands
cartoon_baboon Offline OP
User
cartoon_baboon  Offline OP
User

Joined: Feb 2006
Posts: 616
Netherlands
Hi,
I'm using the toon shader from the GS wiki but when the camera moves away from the models the outline scales smaller (as is to be expected) and as a result looks very ugly and pixelated. Is there a way to adapt the shader to keep the outline thickness a constant size on screen (based on camera distance perhaps)?

By the way, I'm using A6.

Thanks!

cartoon_baboon

Re: Toon shader distance scale [Re: cartoon_baboon] #204637
04/30/08 12:46
04/30/08 12:46
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
yes, you could use this shader, but instead of using material skilly you could use entity skills and create a function to pass a outline scale value based onto the distance

should be easy to do


www.earthcontrol.de
quoted: We want to maintain a clean, decent, American family suited forum look... which means you may post zombies or chainsaw massacres, but no erotic.
Re: Toon shader distance scale [Re: ello] #204648
04/30/08 15:47
04/30/08 15:47
Joined: Feb 2006
Posts: 616
Netherlands
cartoon_baboon Offline OP
User
cartoon_baboon  Offline OP
User

Joined: Feb 2006
Posts: 616
Netherlands
Hi, thanks for the speedy reply^^.

Sounds like it could work - problem is, I've really got no experience with c-script. Don't suppose I could impose a little more and ask how one would have to adjust the code to get that working?

Thanks

cartoon_baboon

Re: Toon shader distance scale [Re: cartoon_baboon] #204663
04/30/08 17:11
04/30/08 17:11
Joined: Jan 2003
Posts: 4,615
Cambridge
Joey Offline
Expert
Joey  Offline
Expert

Joined: Jan 2003
Posts: 4,615
Cambridge
do you know at least *some* c-script?

Re: Toon shader distance scale [Re: Joey] #204705
05/01/08 07:36
05/01/08 07:36
Joined: Feb 2006
Posts: 616
Netherlands
cartoon_baboon Offline OP
User
cartoon_baboon  Offline OP
User

Joined: Feb 2006
Posts: 616
Netherlands
Hi, well I have some experience with c-script and a few years ago I gave it a little try but never got very far - I also know a little of a few other languages but nothing that would let me sort this out^^.

Here's the part that lets you adjust the thickness of the outlines

function dunkelblauedickereLinie()
{
mtl.skill1 = float(0.0);
mtl.skill2 = float(0.0);
mtl.skill3 = float(0.1);
mtl.skill4 = float(1.0);
}


The formula to calculate the scale of something as it gets further away is scale=focallength/(focallength+depth). Once you know how much a model is scaled you just have to multiply the line thickness by (1/scale). But how do I do this in c-script? And what would also be required is to limit the scaling - else when the model get's very far away it'll turn into a weird blob as the lines will start obscuring the model.

Hope someone can help me with this?


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