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
4 registered members (degenerate_762, AbrahamR, AndrewAMD, ozgur), 667 guests, and 8 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 3 of 5 1 2 3 4 5
Re: RE:3D Glasses shader [Re: Scorpion] #104870
01/04/07 12:56
01/04/07 12:56
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline OP
Senior Expert
PHeMoX  Offline OP
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
The borders have to be the same size I think, because it's the overlap of colors that will change the size of the borders anyways. Still, I have been looking on the internet for some examples and found out that most use a way thicker border for each color, so perhaps the current effect won't work.

I have to say though, if I would make a 3D glasses shader from scratch, I would probably make 3 layers of the total scene, one layer in red, one in blue and one for example green and change their offset and add them together.

As soon as I get my hands on 3D glasses, I will change the code some more,

Cheers


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Re: RE:3D Glasses shader [Re: PHeMoX] #104871
01/04/07 13:15
01/04/07 13:15
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
for a real 3d-glass effect you'd need to take the depth information into account. the distance between the red and the blue extraction depends on the distance

btw, you may need a materialskill to define those colors, as there are red/green glasses, too

Re: RE:3D Glasses shader [Re: ello] #104872
01/04/07 13:36
01/04/07 13:36
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline OP
Senior Expert
PHeMoX  Offline OP
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
Quote:

for a real 3d-glass effect you'd need to take the depth information into account. the distance between the red and the blue extraction depends on the distance




Mmmm, okey, I wonder if this could be accomplished by using a fixed focal point in the center of the screen. At the moment I wouldn't really know how to change the thickness based on the position on screen, but if it needs the depth to even work. Maybe not quite worth it spending more time on this one?

Cheers


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Re: RE:3D Glasses shader [Re: PHeMoX] #104873
01/04/07 14:46
01/04/07 14: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
well, i think it is worth, as it is a great effect to have some more 3d-feeling. while reading the thing about a focal point , you could be right.. maybe you have to take both the focal point and the depth into account for proper calculations

Re: RE:3D Glasses shader [Re: ello] #104874
01/04/07 15:43
01/04/07 15:43
Joined: Mar 2001
Posts: 3,298
Beverly, Massachusetts
Rhuarc Offline
Expert
Rhuarc  Offline
Expert

Joined: Mar 2001
Posts: 3,298
Beverly, Massachusetts
Quote:

well, i think it is worth, as it is a great effect to have some more 3d-feeling. while reading the thing about a focal point , you could be right.. maybe you have to take both the focal point and the depth into account for proper calculations




Yes, both are neccesary, although it wouldn't be a focal point, but rather a focal range- which would just be a value of distance that the camera is focusing on. You could do this by rendering with a second camera and use an alternate shader to render every element with depth information, then use this texture as a mtlTex and then use the values as your offset thickness.

-Rhuarc


I no longer post on these forums, keep in touch with me via:
Linkedin.com
My MSDN blog
Re: RE:3D Glasses shader [Re: Rhuarc] #104875
01/04/07 21:49
01/04/07 21:49
Joined: Sep 2002
Posts: 8,177
Netherlands
PHeMoX Offline OP
Senior Expert
PHeMoX  Offline OP
Senior Expert

Joined: Sep 2002
Posts: 8,177
Netherlands
Lol! Okey, but before I could accomplish that I'd need to learn more HLSL. Still, this post-processing stuff is pretty cool.

Cheers


PHeMoX, Innervision Software (c) 1995-2008

For more info visit: Innervision Software
Re: RE:3D Glasses shader [Re: PHeMoX] #104876
01/04/07 22:55
01/04/07 22:55
Joined: Jan 2007
Posts: 1,619
Germany
Scorpion Offline
Serious User
Scorpion  Offline
Serious User

Joined: Jan 2007
Posts: 1,619
Germany
if you would have for every object its own deep, are problems with big objekts like terrain or just the whole level. so i would say the only possible thing is to render 2 views on the screen (red+green)
Or is it possible to get the deep of every pixel?! *noobatshader*

Re: RE:3D Glasses shader [Re: Scorpion] #104877
01/04/07 23:01
01/04/07 23:01
Joined: Aug 2002
Posts: 681
Massachusetts, USA
Ichiro Offline
User
Ichiro  Offline
User

Joined: Aug 2002
Posts: 681
Massachusetts, USA
Or is it possible to get the deep of every pixel?!

I think Ello was talking about this, and I'd sure like to figure out how.


Dejobaan Games - Bringing you quality video games for over 75 years.
Re: RE:3D Glasses shader [Re: Ichiro] #104878
01/05/07 02:57
01/05/07 02:57
Joined: Oct 2005
Posts: 4,771
Bay City, MI
lostclimate Offline
Expert
lostclimate  Offline
Expert

Joined: Oct 2005
Posts: 4,771
Bay City, MI
well from discussions i've read on her about DOF you need whats called a depth map, it just tells you how far the pixel is away, so basically yeah thats what you'd need, the only problem is........... a6 users dont have access to it... so yeah as far as that goes were screwed

Re: RE:3D Glasses shader [Re: lostclimate] #104879
01/05/07 08:00
01/05/07 08:00
Joined: Oct 2002
Posts: 8,939
planet.earth
ello Offline
Senior Expert
ello  Offline
Senior Expert

Joined: Oct 2002
Posts: 8,939
planet.earth
it is possible by using material events and for one view you only render the objexts with a greyscale depending on the depth.

this could look like:

Code:

struct VS_IN
{
float4 position : POSITION;
};

struct VS_OUT
{
float4 position : POSITION;
float depth : TEXCOORD0;
};

float front = 100;
float back = 300;


VS_OUT mainVS (VS_IN In)
{
VS_OUT Out;
Out.position = mul(In.position, matWorldViewProj);
Out.depth = ((Out.position.z - back)/1000) * ((Out.position.z - front)/1000);
return Out;
}

float4 mainPS (VS_OUT In) : COLOR0
{
return In.depth;
}

technique depth
{
pass p0
{
VertexShader = compile vs_2_0 mainVS();
PixelShader = compile ps_2_0 mainPS();
}
}



there may be other, better approaches of course

Page 3 of 5 1 2 3 4 5

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