Custom 3D GUI Game Engine With Textures

you are slowly turning into egomoose and I love it

3 Likes

I feel like the fisheye adds for effect to the PS1 style since the fat TV’s we’re square and curved

2 Likes

I am unsure if the fisheye lens fix will even work for your method. But when I was working on my 2D Raycast Renderer I also asked for some help, here’s what @edenojack had to say:

Specifically, the video relating to Wolfenstein’s way of clearing the effect. It’s been a while since I last watched the video, so I am no longer sure what the fix was but I do know that you can see major improvements from my first rendition to my second version of the raycaster:
https://www.roblox.com/games/3608191441/2D-Raycast-Renderer


Also, Grazi

1 Like

The video in the linked post should help actually, specifically from here;

It sounds like you’ve found the position you’ve hit the object, and are just having a little bit of issue with the adjustments to the FOV, this video should help descibe the equations and reasons behind what you’ll need to do next.

2 Likes

I’ve almost fixed the fisheye effect

But there is a new distortion now.
It appears that the higher the angle is, the taller the walls will strech.

image

This is more obvious with higher FOV

image

Anyone know why this is?

local Distance = (ViewRayOrigin - ViewRay.Position).Magnitude

-- Remove that fisheye effect		
local RayAngleX, RayAngleY, RayAngleZ = RayAngle:ToEulerAnglesXYZ()	
			
Distance = Distance * math.cos(RayAngleY)
1 Like

I know this isn’t relevant right now but does this support meshes?

1 Like

yes, but you wont get a 3D model. You have to remember that this is actually a 2D top-down map.

It is just being rendered to look like its 3D. This explains why you cannot look up or down as well.

image

3 Likes

Ah I see, that would make sense.

I seem to have a major FPS drop when I walk into walls.

1 Like

That’s odd. I can’t seem to reproduce that issue.

I’m also planning on redoing wall collisions overall. Hopefully that will fix your issue.

I just rejoined and it didn’t happen this time, weird.

It may have happened after I messed around with settings and then I reset my character.

Hey so I was playing around and found that you can get the equivalent of CharacterAngle by simply:

local CharacterAngle = math.rad(-CharacterPart.Orientation.Y)

This is actually intended behavior.

Imagine that your FOV is 360, you would be able to see all around you. The problem then becomes how could you possibly represent those straight lines all around you without curving them? You can’t.

That sort of opposite fish eye effect happens when your FOV is too high for the width of the screen. Frankly I reccomend you just widen the viewport.

Wow. That is cool. How does it run so well?

1 Like

I am trying this thing out as soon as I get on my computer in the morning!
Bet it would be possible to create a awesome Puppet Combo game remaster.

Great job! :+1:

1 Like

huh. Well I finally got your formula to work, but I get the exact outcome as using my other method. Which means curve on the outside.

local Distance = (ViewRayOrigin - ViewRay.Position).Magnitude

-- Remove that fisheye effect		
local RayAngleX, RayAngleY, RayAngleZ = RayAngle:ToEulerAnglesXYZ()	
local CameraAngleY = math.rad(-CameraPart.Orientation.Y)	
			
Distance = Distance * math.cos(RayAngleY - math.rad(CameraAngleY))

Is there a way to fix this without changing the viewport size?

Okay just had an idea.
Aside fomr keeping your FOV low, you could possibly simulate a wider viewport but only display the box.
That would remove the effect.

Although now that I’m thinking about it, that’s literally just the same as keeping your FOV low.

Even with low FOV there is still slight distortion on the edge of the screen.

I feel like we could use math.sin() to fix this issue somehow.

I honestly don’t see the issue.

With an FOV of 60 the distortion should be dismal and only in corners.

If you are using textures, the distortion is a lot more obvious. But since your walls are plain, its hard to tell unless I outline it.

even then, 60 FOV for me has greater distortion than yours.

weird…

Can I get a picture of your renderer with 360 fov?