"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!

6 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)

6 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