Ameshi Posted July 13, 2016 Share Posted July 13, 2016 Hello guys, I'm trying to do some mirrors, and in my first try I used a Camera render target. Camera render target looks like a good solution for security cameras and such, but as a mirror not so much :/ Anyone know how I could do a mirror, like the one in the video? I mean reflect stuff based the angle that you look at it. Quote Link to comment Share on other sites More sharing options...
Genebris Posted July 13, 2016 Share Posted July 13, 2016 Why don't you just rotate the camera depending on player position? 1 Quote Link to comment Share on other sites More sharing options...
Ameshi Posted July 13, 2016 Author Share Posted July 13, 2016 Why don't you just rotate the camera depending on player position? Hello and thank you for your suggestion, I will do some tests. Maybe we can use some shader or probes to do the same? Quote Link to comment Share on other sites More sharing options...
nick.ace Posted July 13, 2016 Share Posted July 13, 2016 The probes aren't dynamic, so you won't be able to see the player. The SSLR shader won't work because the back of the player will be culled in a third person game and hidden in a first-person game. Basically, you can't use that shader for anything that's not currently displayed on camera. Quote Link to comment Share on other sites More sharing options...
Ameshi Posted July 13, 2016 Author Share Posted July 13, 2016 Hello nick, And this shader? http://www.sharecg.com/v/81125/browse/21/DAZ-Studio/Iray-Mirror-Shader The only way to do a mirror is with Camera render target? Quote Link to comment Share on other sites More sharing options...
nick.ace Posted July 13, 2016 Share Posted July 13, 2016 Yes, that's the only way for now. Quote Link to comment Share on other sites More sharing options...
Genebris Posted July 13, 2016 Share Posted July 13, 2016 If you need realtime then you need to render each frame, so yes, camera. Quote Link to comment Share on other sites More sharing options...
Josh Posted July 13, 2016 Share Posted July 13, 2016 Yep, you've basically got to position and rotate the camera opposite of the player eye, across the plane. I haven't done this, but our water reflections work the same way. Now with water reflection on a vertical plane, I scale the camera by 1,-1,1 so the image is inverted. You might have to experiment with this, or maybe just drawing the image backwards on the mirror surface will work. Finally, you will need a clipping plane across the mirror surface, so the reflection doesn't include objects behind the mirror. You can transform the plane of the mirror to camera space (Transform::Plane()) and send this to your mirror shader, then set the super-secret GraphicsDriver clipplane member to this: graphicsdriver->clipplane[0] = plane; This plane will then be uploaded to every shader. This requires C++, so the pro edition is needed. It's not really supported right now, but it is possible to implement and if you get anywhere with it I'm happy to do what I can on my end to make it easier. A reusable mirror plane prefab would be a pretty cool addition to the Workshop. 2 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
DooMAGE Posted October 16, 2017 Share Posted October 16, 2017 Anyone else tried to do a Mirror reflection in your game? Tried "Camera render target" but it looks weird Quote My Leadwerks games! https://ragingmages.itch.io/ Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.