Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Transparent texture same wrap on both sides? Must be an easy solution?

Author
Message
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 11th Jul 2017 16:01
I have this problem where a transparent texture needs to have the same aspect from both faces.

See the two screen shots from both sides below.

Apart from flipping the UV when the camera is on either side, is there any other way to fix this?

Attachments

Login to view attachments
GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 11th Jul 2017 17:04 Edited at: 11th Jul 2017 17:12
I'd guess make it 2-sided mapped on each side as you'd want it to appear from that viewing angle? Assuming the far side is culled out there'd be no artifacts from seeing part of that backside through the front side.

I'm not quite sure what we're looking at and being on cell phone makes that worse probably. lol

And worse I'm not that experienced in 3D yet.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 11th Jul 2017 17:51 Edited at: 11th Jul 2017 17:51
Where is the problem with changing the UV coordinates..you can change the UV of every Vertex individually ...no camera checking needed

Using AGKv2 Tier1
nz0
AGK Developer
17
Years of Service
User Offline
Joined: 13th Jun 2007
Location: Cheshire,UK
Posted: 12th Jul 2017 19:01 Edited at: 12th Jul 2017 19:07
@janbo its the same vertex for each side? All 4 corners are the same for both sides of a plain?
@Garbenjamin the "back" isn't dynamically the side you aren't looking at - the back is always the back and the front is always the front, hence having to decide which is the back / front depending on which side you are looking at at that time.

I've solved it by changing the UVs as the camera is looking at either side, but wondered if there was a way to have a permanent solution on a plain. At the moment, I guess I would have to make my own object and texture a different front and back onto it otherwise.

GarBenjamin
AGK Developer
7
Years of Service
User Offline
Joined: 30th Nov 2016
Location: USA
Posted: 12th Jul 2017 20:07 Edited at: 12th Jul 2017 20:08
@nz0 Really?! That doesn't make sense though. In any game like FPS / TPS I've always heard the back faces are culled and not even displayed and the only way that makes sense would be if it is the face on the other side of the object furthest from the camera. Because what is the back face now will be the front face as soon as player walks aways and turns around.

At least I thought so. Granted like I said I have only a shallow knowledge of 3D at this point.
TI/994a (BASIC) -> C64 (BASIC/PASCAL/ASM/Others) -> Amiga (AMOS/BLITZ/ASM/C/Gamesmith) -> DOS (C/C++/Allegro) -> Windows (C++/C#/Monkey X/GL Basic/Unity/Others)
Jeff Miller
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 12th Jul 2017 22:00
The only way I have ever achieved this is to make a two sided plain (6 vertices), 2 triangles for the front and 2 for the back, the back sharing only 2 vertices with the front.
janbo
15
Years of Service
User Offline
Joined: 10th Nov 2008
Location: Germany
Posted: 12th Jul 2017 22:58 Edited at: 13th Jul 2017 00:22
Quote: "@janbo its the same vertex for each side? All 4 corners are the same for both sides of a plain?"

Nope in AppGameKit it does have 12 vertices so it is double sided.
As backface culling is off, but you can see both sides...

Check(12 vertices 4 triangles):


Using AGKv2 Tier1
Jeff Miller
19
Years of Service
User Offline
Joined: 22nd Mar 2005
Location: New Jersey, USA
Posted: 13th Jul 2017 22:44
Don't you mean vertex indices, rather than vertices? (3 per triangle, 4 triangles) . The number of vertices processed will always be twelve since on each side the two vertices that define a hypotenuse common to both triangles making up the rectangular face will be processed twice. I think it would only need contain 6 vertices to support the 4 triangles in a manner to accommodate the texture nZO has in mind. It can be done with 8 vertices, but that is not necessary.

Login to post a reply

Server time is: 2024-09-30 05:25:48
Your offset time is: 2024-09-30 05:25:48