"Dual Render" Scope System

Haha whoops! Thank you!

I changed it to 500x500 and reuploaded to the OP!

2 Likes

Why would you say

THIS IS NOT SUITABLE FOR A PRODUCTION GAME ENVIRONMENT. It is an interesting tech demo prototype, but is absolutely an abuse of ViewportFrames. Note that it slows exponentially- the more objects, the slower it gets. Iā€™ve optimized plenty, but it is not enough.

If it works fine at 60fps? As long as youā€™re not cloning players every single frame, but updating their CFrame and running animations locally it should work perfectly fine in a production game.

I had a project where I rendered every single player locally, updated their position and animation every couple of frames and it worked perfectly fine with over 100 players at once. (This was on top of many other calculations like inverse kinematics and other game logic running at the same time)

4 Likes

Youā€™re forgetting something. Iā€™m not just moving parts, Iā€™m moving them inside a ViewportFrame! This means the frame has to render all over again!

Although I did optimize plenty, when you add even more parts it will slow the refresh rate of the ViewportFrame. The game will run at 60FPS still, but the scope will look laggy.

Also, the ViewportFrame itself is not good in many situations. It canā€™t render terrain, particles, or complex lighting!

3 Likes

Ah I see, if the ViewportFrame didnā€™t slow down then it wouldnā€™t be a problem.

2 Likes

Fixed the bugs, and uploaded the patched file to the OP!

1 Like

Also, the ViewportFrame itself is not good in many situations. It canā€™t render terrain, particles, or complex lighting!

There is still this, however.

1 Like

I never even thought of using ViewportFrames for this kind of stuff, good thinking!

2 Likes

Yes!!! I have a prototype working for blurring the world but not the scope!

Told you I was working on that :smirk:

Updated the OP to have this new feature!

7 Likes

Okay thatā€™s epic. Now Iā€™m tempted to indulge on this abuse of features for my projects and Iā€™ve gotta praise you for sharing this resource.

This is simply amazing.

8 Likes

I updated the OP to explain this, and give the new file. (Along with fixes and optimization)

2 Likes

This is really cool. However, it demonstrates that it would be really nice to be able to simply throw additional cameras into the world and render them on a frame

6 Likes

One can only dreamā€¦

But Iā€™ll make hacky things in the meantime :yum:

4 Likes

Try to make something as smooth and as seamless as portals from Portal / Portal 2. I plan on doing something similar, but with the hacky teleporting thing which is kinda bad imo.

Something like this:

I donā€™t know if itā€™s entirely possible to shunt things through two ā€œportalsā€ like a laser properly. Could be wrong however.

2 Likes

What a great gameā€¦ good memories.

Now, portals are a very curious thing, because you have to be able to look in it at angles and see different thingsā€¦ I will give it a go.

Later. Iā€™m pretty tired of ViewportFrames by now. :sweat_smile: Thatā€™s what happens when you spend ~25 hours within a 48 hour period working on them. :neutral_face:

Edit:
Who am I kidding, I canā€™t resist a challenge!

7 Likes

See, I think itā€™d be pretty easy, though I canā€™t have the proper angle thing, plus I canā€™t make it so players and objects and lasers seamlessly pass through them.

Iā€™m still relying on the teleport method. :man_shrugging::joy:

2 Likes

Oh yeah, I have no clue how to make it teleport well.

2 Likes

Because ViewportFrames donā€™t render themselves, we wonā€™t get cool effects like these:

5 Likes

Perhaps when Roblox adds the rest of the features to viewport frames, thisā€™ll be possible?

I know theyā€™ll be adding in the rest of the effects to ViewPortFrames later on, like lighting, particles, and possibly surface / billboard guis.

4 Likes

This is super cool. I took a shot at making a night vision scope.

Not too hard to do, just make the lighting super dark and then add a green frame behind the scope image. Turns out pretty cool, if I do say so myself.

Night vision scope.rbxl (1.2 MB)

7 Likes

That looks super awesome!

Youā€™ll want to set the green frame to have a border pixel size of 0, or you can see the square of the Viewport. Donā€™t ruin the illusion!

3 Likes