Viewmodel Hybrid (Without matrices)

I followed HL2’s approach with viewmodel clipping, nearplanes, fixed scale/positions, etc.
They use a very simple and really interesting choice of methods, I tried to recreate most of it on Roblox and it kind of feels identical just without the single camera

(This is not where most roblox games make their secret as to just scale their viewmodels to around 0.1 and make a cylindrical hitbox. This viewmodel can be set to any scale it just depends on the world object’s offset)

(since all source games can alter and render the projection/view matrix of independent assets & roblox ofc does not support that kind of stuff)

This system uses a viewportframe and a regular object in the camera. (The best way to handle viewmodel clipping, world interactions, and handle lighting) ← imo

and FOV scaling/positioning can be adjusted pretty easily (well of course this is based off the old source viewmodels not also considering CS2’s, since that definitely uses some shaders and we don’t have that currently in roblox)

comparisons:

functionality:

2 Likes

This is cool! Are you planning on implementing it into any games?

yeah, it’s already implemented into one of my games and works good if you don’t have 100% dynamic foliage (this still intersects with any object that’s in the player’s cameraclippingplane, which is the same with source games)

Edit: I found a solution to make it not intersect with foliage, so it clips with nothing now :slight_smile:
(except water ofc)

1 Like

viewport frames could be laggy, dont have great performance and cant render particles, i wouldnt use this method

Render particles like in source games, it’s separate from the barrel attachment itself
in terms of lag well it shouldn’t really be too bad i’ve been using a viewportframes for a while haven’t noticed too much differences