[QUOTE=Jinto]-image-
[url]http://www.wegame.com/watch/Portaly_Goodness/[/url]
[url]http://www.wegame.com/watch/Portal_View_Accuracy/[/url][/QUOTE]
Holyshit that's awesome.
[b]Edit:[/b]
Here have a cookie (No I'm not exaggarating at all...)
[media]http://neatorama.cachefly.net/images/2006-07/world-biggest-cookie.jpg[/media]
[media]http://technabob.com/blog/wp-content/uploads/2007/04/super_mario_cookie.jpg[/media]
[media]http://www.elitechoice.org/wp-content/uploads/2007/11/citycookies.jpg[/media]
[media]http://www.elitechoice.org/wp-content/uploads/2007/11/cookies_city.jpg[/media]
[QUOTE=Jinto][img_thumb]http://cdbarrett.com/dump/gm_construct0002.jpg[/img_thumb]
[url]http://www.wegame.com/watch/Portaly_Goodness/[/url]
[url]http://www.wegame.com/watch/Portal_View_Accuracy/[/url][/QUOTE]
What happens if I put and object half way, freeze it at portal blue and defreeze it at portal orange ?
Jinto stop, please stop, I'm begging. I don't know how much more my ego can take. :(
[QUOTE=OlivierHamel]Jinto stop, please stop, I'm begging. I don't know how much more my ego can take. :([/QUOTE]
Keep going Jinto, maybe we'll get rid of him once and for all!
[QUOTE=OlivierHamel]Jinto stop, please stop, I'm begging. I don't know how much more my ego can take. :([/QUOTE]
Haha, agree!
what happens to an object frozen halfway into a portal when one of them (the portals) is removed? And can you use the toolgun/weapons through it?
Is anyone going to make something with this and release it? I would try myself but I have almost no knowledge of lua and I am still only just learning.
That. Is. Incredible.
One of the two GMod Impossibles has been made possible. I'm sure Chainsaw STools will be soon to come, not to mention a properly working Portal Gun. :)
All we need now is a dynamic water DLL. ;)
[QUOTE=OlivierHamel]Jinto stop, please stop, I'm begging. I don't know how much more my ego can take. :([/QUOTE]
Yeah.. comparing yourself to Jinto, sure.. okay..
[QUOTE=Jinto][img_thumb]http://cdbarrett.com/dump/gm_construct0002.jpg[/img_thumb]
[url]http://www.wegame.com/watch/Portaly_Goodness/[/url]
[url]http://www.wegame.com/watch/Portal_View_Accuracy/[/url][/QUOTE]
Also for the love of god example codes of this would be the greatest thing
Here is the code to calculate the view through the portal.
[lua]// get the portal planes
local plane = self:GetPlane();
local other_plane = portal:GetPlane();
// quick access
local normal = plane:GetNormal();
local distance = plane:GetDistance();
local forward = angles:Forward();
local up = angles:Up();
// reflect origin
local dot = origin:DotProduct( normal ) - distance;
origin = origin + ( -2 * dot ) * normal;
// reflect forward
local dot = forward:DotProduct( normal );
forward = forward + ( -2 * dot ) * normal;
// reflect up
local dot = up:DotProduct( normal );
up = up + ( -2 * dot ) * normal;
// convert to angles
angles = VectorAngles( forward, up );
// convert to the local
local LocalOrigin = self:WorldToLocal( origin );
local LocalAngles = self:WorldToLocalAngles( angles );
// repair
LocalOrigin.y = -LocalOrigin.y;
LocalAngles.y = -LocalAngles.y;
LocalAngles.r = -LocalAngles.r;
// transform to the other portals space
view.origin = portal:LocalToWorld( LocalOrigin );
view.angles = portal:LocalToWorldAngles( LocalAngles );
// figure out which rendertarget to use
local RenderTarget = Orange;
if( self:GetPortalType() == TYPE_BLUE ) then
RenderTarget = Blue;
end
// get the old rendertarget
local oldrt = render.GetRenderTarget();
// set the rendertarget
render.SetRenderTarget( RenderTarget );
// push the clip plane
render.PushCustomClipPlane( other_plane );
// clear
render.Clear( 0, 0, 0, 255 );
render.ClearDepth();
render.ClearStencil();
// hide view model
LocalPlayer():GetViewModel():SetNoDraw( true );
// draw
RENDERING_PORTAL = true;
render.RenderView( view );
RENDERING_PORTAL = false;
// show view model
LocalPlayer():GetViewModel():SetNoDraw( false );
// pop plane
render.PopCustomClipPlane();
// restore
render.SetRenderTarget( oldrt );[/lua]
It's called from RenderScene.
To render the portal itself.
[lua]// setup the stencil buffer
render.ClearStencil();
render.SetStencilEnable( true );
render.SetStencilFailOperation( STENCILOPERATION_KEEP );
render.SetStencilZFailOperation( STENCILOPERATION_KEEP );
render.SetStencilPassOperation( STENCILOPERATION_REPLACE );
render.SetStencilCompareFunction( STENCILCOMPARISONFUNCTION_ALWAYS );
render.SetStencilWriteMask( 1 );
render.SetStencilReferenceValue( 1 );
// draw the model into the stencil buffer
self:DrawModel();
// setup the stencil buffer
render.SetStencilTestMask( 1 );
render.SetStencilCompareFunction( STENCILCOMPARISONFUNCTION_EQUAL );
render.SetStencilPassOperation( STENCILOPERATION_REPLACE );
// disable depth writing
render.OverrideDepthEnable( true, false );
// draw
PortalMaterial:SetMaterialTexture( "$basetexture", RenderTarget );
render.SetMaterial( PortalMaterial );
render.DrawScreenQuad();
// enable depth writing
render.OverrideDepthEnable( false, true );
// disable stencil buffer
render.SetStencilEnable( false );[/lua]
[QUOTE=Jinto]*crazy stuff*[/QUOTE]
:wooow:
This is fucking amazing. Bravo.
[QUOTE=Jinto][lua]Codes[/lua][/QUOTE]
Awesome, thank you
This is... Inspiring... Breathtaking even.
But did my eyes decieve me or can you not actually 'phyiscs' an object coming out one of your portals yet? :P
Either way this is an incomparible breakthrough. I tip my hat to thee sir, and as it seems to be the currency these days, have a cookie.
Well, I don't think dynamic water is impossible anymore. If he figured this out, it's not long until he or someone else gets dynamic water.
[QUOTE=nofearkid]Well, I don't think dynamic water is impossible anymore. If he figured this out, it's not long until he or someone else gets dynamic water.[/QUOTE]
Shader buffers have been around for a while. What you are speaking about is uncharted waters, although I believe I would be the beneficiary of dynamic water with my games and am anticipated to see the upcoming game 'Hydrophobia' and see it's water.
Hmm yea... I hate predicting the future before looking at all posts. (posted about portal before seeing 2nd page).
Anyway, one problem I noticed in [url]http://www.wegame.com/watch/Portal_Prototype_3/[/url] is that the portal view is a mirror image of how it looks in actual Portal.
Should be an easy fix to mirror it the other way, but it's just bugging my eyes that the covered area appears mirrored 30 seconds or so in.
[QUOTE=nicktelli]Hmm yea... I hate predicting the future before looking at all posts. (posted about portal before seeing 2nd page).
Anyway, one problem I noticed in [url]http://www.wegame.com/watch/Portal_Prototype_3/[/url] is that the portal view is a mirror image of how it looks in actual Portal.
Should be an easy fix to mirror it the other way, but it's just bugging my eyes that the covered area appears mirrored 30 seconds or so in.[/QUOTE]
Old video, I fixed that already.
[url]http://www.wegame.com/watch/Portal_Player_Demonstration/[/url]
[QUOTE=Jinto]Old video, I fixed that already.
[url]http://www.wegame.com/watch/Portal_Player_Demonstration/[/url][/QUOTE]
HOLY **** I WANT IT
[QUOTE=The_jumper]What happens if I put and object half way, freeze it at portal blue and defreeze it at portal orange ?[/QUOTE]
and
[QUOTE=Levybreak]what happens to an object frozen halfway into a portal when one of them (the portals) is removed? And can you use the toolgun/weapons through it?[/QUOTE]
There will be solutions for these special situations. These issues are peanuts compared to the portals itself. I'm sure that Jinto can handle it easily.
Easiest answer to those questions above is: It will work how you expect it to work (e.g. like in Portal)
You could overwrite util.TraceLine and bullet callbacks.
I'm gonna try that now :D
[QUOTE=aVoN]and
There will be solutions for these special situations. These issues are peanuts compared to the portals itself. I'm sure that Jinto can handle it easily.
Easiest answer to those questions above is: It will work how you expect it to work [b](e.g. like in Portal)[/b][/QUOTE]
Yes but, in portal there is not this problem, because there are no physgun so, as if this issue was in, we wouldn't notice it...
But I'm sure Jinto will find a solution :)
[QUOTE=Termy58]Shader buffers have been around for a while. What you are speaking about is uncharted waters, although I believe I would be the beneficiary of dynamic water with my games and am anticipated to see the upcoming game 'Hydrophobia' and see it's water.[/QUOTE]
Hydrophobia has been "upcoming" for ages now. :v:
Is there a SWEP to make a prop into a mirror using this new DLL, so dumbasses like me don't have to code it?
[QUOTE=Deco Da Man]You could overwrite util.TraceLine and bullet callbacks.
I'm gonna try that now :D[/QUOTE]
HL2 sweps don't use util.TraceLine but for all other intensive purposes it should work, the problem being you will slow down anything that uses util.TraceLine.
[QUOTE=DrFattyJr]HL2 sweps don't use util.TraceLine but for all other intensive purposes it should work, the problem being you will slow down anything that uses util.TraceLine.[/QUOTE]
Even if you override util.TraceLine, traces through a portal opens another issue.
It's a double trace, from source to portal, then from portal to destination. Some things create effects along the traced line, tracers for example. It'd look awfully funny having a weapon tracer fly sideways because the exit position is across the map.
Jinto... You made my life :)
[QUOTE=Jinto]Even if you override util.TraceLine, traces through a portal opens another issue.
It's a double trace, from source to portal, then from portal to destination. Some things create effects along the traced line, tracers for example. It'd look awfully funny having a weapon tracer fly sideways because the exit position is across the map.[/QUOTE]
Surely this wouldn't be a problem if you set up a new trace for each "jump"?
Oh wait I see what you mean now, interesting problem. It's probably better to have the functionality in place and have it look a bit dodgy than have traces hit the portals and stop.
Well I'm having fun making a little teleporter thingy.
[img]http://img232.imageshack.us/img232/433/tele1hl6.jpg[/img]
[img]http://img337.imageshack.us/img337/824/tele2nf7.jpg[/img]
[img]http://img401.imageshack.us/img401/3237/tele3ws4.jpg[/img]
[b]Edit:[/b]
First one to figure out how I did this gets a cookie.
[img]http://img509.imageshack.us/img509/3790/ballskm4.jpg[/img]
[img]http://img300.imageshack.us/img300/605/balls2ns0.jpg[/img]
Sorry, you need to Log In to post a reply to this thread.