Oh snap.
That's all I can think to say. I'm going to have to look at this closely...
Very impressive, good use of the SDK.
A bit not related questions: how did you include files from the engine and what settings did you use for compiling? I tried including some files, the includes worked but then I started getting some linker errors. I tried including just one file in a blank project but I am still getting them.
[QUOTE=Nevec]A bit not related questions: how did you include files from the engine and what settings did you use for compiling? I tried including some files, the includes worked but then I started getting some linker errors. I tried including just one file in a blank project but I am still getting them.[/QUOTE]
He's Jesus, that's how.
There are plenty of people in this thread that are a bit confused on the possibilities of this. Could someone please explain what this could theoretically allow us to do in a way that average players can understand? Thank you.
I have never used a module before, but would i have to use require() in my cl_init to use this?
Yes, gmcl_renderx.dll in lua/includes/modules, then require( "renderx" ) in your script.
[QUOTE=jockmo42]There are plenty of people in this thread that are a bit confused on the possibilities of this. Could someone please explain what this could theoretically allow us to do in a way that average players can understand? Thank you.[/QUOTE]
This won't really be of use unless you know what clipping planes and the stencil buffer are.
[list]
[*][url]http://en.wikipedia.org/wiki/Stencil_buffer[/url]
[*][url]http://www.whiterockscience.com/moritz/clip_plane.html[/url]
[/list]
So can someone make a nice STOOL that can turn a prop into a clipping plane? I've got an idea for something that would require props appearing to disappear into the middle of nowhere, and that would be awesome!
Someone should make a chainsaw swep with this. Amazing work, Jinto
I see what the stencil and clip planes look like but what is different with the fog and give pictures if possible. Also AWESOME WORK!
Pretty damn awesome:
[lua]
function ENT:Draw()
local plane = Plane(self:GetUp(), self:GetPos()+self.BottomOffset+self.VolumeVector)
render.EnableClipping(true)
render.PushCustomClipPlane(plane.Normal, plane.Distance)
self:SetColor(255,255,255,255)
self:DrawModel();
render.PopCustomClipPlane();
render.PushCustomClipPlane(-plane.Normal, plane.Distance)
self:SetColor(self.HoldingColor)
self:DrawModel();
render.PopCustomClipPlane();
end
[/lua]
Pics soon.
Finally! You can now setup a per-entity clipping plane, that doesn't require access to the Draw method for existing props and npcs. It also clips the entity's shadow. I'll update the binary when I tweak a few more things. I'll also be releasing a mathlib module that has some matrix and plane operations. You'll still be able to use the current method of supplying a plane to PushCustomClipPlane but it'll also accept the VPlane from my other module.
[img_thumb]http://cdbarrett.com/dump/gm_flatgrass0131.jpg[/img_thumb]
It appears to work on players as well, to hide the weapon you'll need to set the clip plane of GetActiveWeapon().
[img_thumb]http://cdbarrett.com/dump/gm_flatgrass0132.jpg[/img_thumb]
By the way, if anyone wants to get access to C_BaseEntity.
[code]// get client factory
CreateInterfaceFn ClientFactory = Sys_GetFactory( "client.dll" );
// get the entity list interface
cliententitylist = (IClientEntityList*)ClientFactory( VCLIENTENTITYLIST_INTERFACE_VERSION, NULL );
if( !cliententitylist )
{
Lua()->Error( "Failed to get required interfaces.\n" );
return 0;
}[/code]
[code]C_BaseEntity* ent = (C_BaseEntity*)cliententitylist->GetClientEntityFromHandle( *(CBaseHandle*)Lua()->GetUserData( 1 ) );[/code]
Works on all entities. But the downside is, there is only 1 plane per entity. But that shouldn't be too much of a hindrance.
[lua]ent:SetRenderClipPlaneEnabled( true );
ent:SetRenderClipPlane( VPlane( Vector( 0, 0, 1 ), e:GetPos() ) );
[/lua]
[b]Edit:[/b]
Updated the download links on the first page, adds 2 more methods. SetRenderClipPlaneEnabled and SetRenderClipPlane.
:fap:
Here is a video of the SetRenderClipPlane function in action.
[url]http://www.wegame.com/watch/Clipping_Planes/[/url]
[b]Edit:[/b]
Fixed some typos that caused PushCustomClipPlane to crash.
[b]Edit:[/b]
More interesting stuff you can do with this.
[img_thumb]http://cdbarrett.com/dump/gm_construct0001.jpg[/img_thumb]
[url]http://www.wegame.com/watch/Mirror/[/url]
[QUOTE=Jinto]More interesting stuff you can do with this.
-snip-
[url]http://www.wegame.com/watch/Mirror/[/url][/QUOTE]
:eek:
That's amazing, and am I right to assume it doesn't work with any camera?
And it's not some sort of a "better" RT screen?
How exactly did you do that? Can you explain just the theory of how it works? Thanks! :)
[B]EDIT:[/B]
Ok I just saw how the player is depicted in the mirror from you video.
And it's different than with the RT screen, for you can see the arm of the player exactly like you can see it from the player perspective. Well, just that the player's view is different.
But am I right to assume from this that you basically tell the engine to render the scene again and instead of "fixating" a player to that view you fixate it on a plane?
That one actually does use a rendertarget. Uses a combination of a special frame buffer sized rendertarget created with render.CreateRenderTargetTexture, clip planes, and the stencil buffer.
The material isn't applied to the model, it's rendered as a transformed screenspace quad with a stencil buffer mask.
[lua]local MirrorRT = render.CreateRenderTargetTexture( "MirrorRT", 0, 0, RT_SIZE_FULL_FRAME_BUFFER, render.GetBackBufferFormat() );[/lua]
Thanks for the info, it will be so awesome when aVoN is going to put this into the Stargates. It feels like a new big milestone in the Stargate's cosmetic functions. :keke:
Thank you so much for making that possible! [img]http://forums.facepunchstudios.com/images/rate/lua_king.png?1[/img]
Cool! Have a Lua king.
:uhoh:
[url]http://www.wegame.com/watch/Portol_Prototype_2/[/url]
Crap, I mispelled Portal. Wegame doesn't let me rename videos :(
[QUOTE=Jinto][url]http://www.wegame.com/watch/Portol_Prototype_2/[/url]
Crap, I mispelled Portal. Wegame doesn't let me rename videos :([/QUOTE]
That's awesome.
[url]http://www.wegame.com/watch/Portal_Prototype_3/[/url] :ninja:
[QUOTE=Jinto][url]http://www.wegame.com/watch/Portol_Prototype_2/[/url]
Crap, I mispelled Portal. Wegame doesn't let me rename videos :([/QUOTE]
Yeah and you can't delete them by yourself either.
But you can write an email to them and ask them to change it. should be possible.
And if not then just reupload your video and ask them to delete the old one.
Did the same yesterday. :)
By the way: Awesome video, you're a genius.
Holy shit :excited:
Wait a second.. Jinto is a mod now??
uuh he deserves it anyway
This is fucking legendary.
did you guys know im part of the team
im idea man! pretty much the most essential part
i accept lua kings
Chad at time of idea:
[img]http://termy58.com/dump/chad/chad.jpg[/img]
Holy fuck, this is AWESOME! now if could just figure out how to use it.!
This Is EPIC
do you know how many people said that this was impossible?! this is so amazing. I am glad you stopped working on VMF suite if this is what you are working on now.
Garry should add this to gmod by default.
Someone had to say it.
Also Jinto, did you see my request?
[url]http://forums.facepunchstudios.com/showthread.php?p=11993308[/url]
Also, :3:
Sorry, you need to Log In to post a reply to this thread.