ZuluTangoDelta Posted June 19, 2015 Share Posted June 19, 2015 Hi i read this ( https://bugs.mtasa.com/view.php?id=8769 ) and try the script but i doesnt work Is it only possible in Mta 1.5 because i only find MRTs in a Mta 1.5 changelog. Link to comment
Ren_712 Posted June 20, 2015 Share Posted June 20, 2015 Hi i read this ( https://bugs.mtasa.com/view.php?id=8769 ) and try the script but i doesnt work Is it only possible in Mta 1.5 because i only find MRTs in a Mta 1.5 changelog. Yes. It is a very interesting 1.5 feature. Link to comment
Ren_712 Posted July 29, 2015 Share Posted July 29, 2015 I made some resources utilising MRT in shader: GlassMan: https://community.multitheftauto.com/ind ... s&id=11781 WaterRefract4test: https://community.multitheftauto.com/ind ... s&id=11780 ObjectPreview: https://community.multitheftauto.com/ind ... s&id=11836 Link to comment
Dealman Posted July 30, 2015 Share Posted July 30, 2015 I made some resources utilising MRT in shader:GlassMan: https://community.multitheftauto.com/ind ... s&id=11781 WaterRefract4test: https://community.multitheftauto.com/ind ... s&id=11780 ObjectPreview: https://community.multitheftauto.com/ind ... s&id=11836 Oh lord Link to comment
Ren_712 Posted February 5, 2016 Share Posted February 5, 2016 PedWall: https://community.multitheftauto.com/in ... ls&id=7615 Link to comment
Ren_712 Posted April 6, 2016 Share Posted April 6, 2016 Camera2RenderTarget: https://community.multitheftauto.com/in ... s&id=12927 Link to comment
Ren_712 Posted April 6, 2016 Share Posted April 6, 2016 Camera2RenderTarget: https://community.multitheftauto.com/in ... s&id=12927 Link to comment
AfterAll14 Posted April 7, 2016 Share Posted April 7, 2016 Can you make vehicle mirror with that? Link to comment
AfterAll14 Posted April 7, 2016 Share Posted April 7, 2016 Can you make vehicle mirror with that? Link to comment
Ren_712 Posted April 8, 2016 Share Posted April 8, 2016 You can update mirror matrix for every frame, so technically yeah. Problem would be that objects outside the viewport get culled - try creating a mirror in a spawnarea and you'll see what i mean. Link to comment
Ren_712 Posted April 8, 2016 Share Posted April 8, 2016 You can update mirror matrix for every frame, so technically yeah. Problem would be that objects outside the viewport get culled - try creating a mirror in a spawnarea and you'll see what i mean. Link to comment
AfterAll14 Posted May 10, 2016 Share Posted May 10, 2016 Ok, I tried to use it for vehicle mirrors. Result is a complete bs. http://www.filedropper.com/plugin-mirrors Just as You said objects in mirrors are mess. And mirrors fov is too small for a car. Maybe You can fix it somehow to make it work for cars Ren? Giving up on idea to create properly working mirrors for cars looks very dissapointing. Link to comment
Ren_712 Posted May 10, 2016 Share Posted May 10, 2016 As long as i can't prevent object culling there is not much that can be done. Link to comment
AfterAll14 Posted May 11, 2016 Share Posted May 11, 2016 I have a question. I want to create 2d mirror like in this video: I tried to replace dxDrawMaterialLine3D with dxDrawImage ( 100, 0, 300, 100, self.shader) in CMat3DProj:draw() function. In result I have black rectangle instead of mirror. How to make it work like that? Link to comment
Wojak Posted May 11, 2016 Share Posted May 11, 2016 The script in that video was a concept made back in 2011! with many flaws, you can download the source code if you haven't yet: https://community.multitheftauto.com/index.php?p= ... ls&id=2870 There where no shader functions in it, I just wanted to find a use for dxCreateScreenSource. The main problem is that you have to devote some frames to simulate the second camera, and you need a way to render the correct image in the right place (I used 2 render targets, one is full screen and the other is the mirror) Link to comment
AfterAll14 Posted May 11, 2016 Share Posted May 11, 2016 Technical idea behind your script is very smart Wojak. But unfortunately those two problems - fps drop and sound issues are too much. I'm building scripts for a new gamemode and script provided by Ren can be a solution to somehow introduce something that will look like rear view mirrors without hurting gameplay too much. Link to comment
Wojak Posted May 11, 2016 Share Posted May 11, 2016 The GTA:SA engine was newer designed to support more then one camera, so making a perfect mirror is not possible even with the Ren's script. The only idea tat come's to mind should allow to simulate left or right side mirror with full FPS and no sound issues (but testing is required): 1) You set the camera matrix to its max FOV (180) and rotate the center of viewpoint until the left (or right) side of the 180 viewpoint would show the same as 70(default) viewpoint. 2) You get the screen source. 3) You create two render targets (one full screen and one for the mirror). 4) You cut the 70/180% of the screen source from the left (or right depending on the rotation from step one), you stretch it and draw on the full screen render target 5) You cut some from the other side of the screen source and draw it to the other render target. I don't know if you understand what I mean, but in theory this should work, but there may be some other problems witch this (stretched default HUD, low quality dune to stretching and such). Link to comment
AfterAll14 Posted May 11, 2016 Share Posted May 11, 2016 I have to say you're creative A quick scetch representing your idea: As you can see the best you will get is 117.5deg when facing somewhere back. Thumbs up for an idea, very funny Link to comment
Ren_712 Posted May 16, 2016 Share Posted May 16, 2016 I have updated the cam2rt resource. A new class cam2RTImage lets you get the render target and draw things as an image. Also remember that the effects have range of 60 units (you might change that - line 12, 13 in the class files). If you change field of view to values above 100 degrees - things start to glitch (especially in vehicles). But for ped - up to 170 degrees seem to look bearable). To get standard (70 degree ) field of view - after setting a ridiculously high value - you can use this simple shader: https://www.dropbox.com/s/ih8hrkdgkcukg ... v.zip?dl=0 1 Link to comment
AfterAll14 Posted May 18, 2016 Share Posted May 18, 2016 Thanks! That works. Some kind of rear view mirror for vehicles is now possible. Objects are culled, but no performance drop and no other issues as far as I tested. GJ Ren! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now