Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
Can you create a mirror in CopperCube?

luposian
Registered User
Quote
2023-11-06 06:29:37

A vertical surface that actually reflects what is in front of it (such as my character), in real time.


SamGrady
Guest
Quote
2023-11-06 08:06:54

In the new version, you can achieve this with render to texture methods. Simply place a camera in the correct position and set the field of view (FOV) for rendering the image onto your mirror mesh.


luposian
Registered User
Quote
2023-11-06 08:30:59

SamGrady wrote:
In the new version, you can achieve this with render to texture methods. Simply place a camera in the correct position and set the field of view (FOV) for rendering the image onto your mirror mesh.

The new version of... CopperCube? You mean 6.7? Or are you referring to CopperCube 6.6 as the new version?

And can you provide/show an example of doing this?


SamGrady
Guest
Quote
2023-11-06 09:35:42

I'm referring to version 6.6. I can demonstrate some results shortly. It only takes 10 minutes to achieve this.


SamGrady
Guest
Quote
2023-11-06 10:13:23

It looks like this:
🔎︎



Alireza
Guest
Quote
2023-11-06 14:10:33

@samGrady
Can you send source(.ccb) to me please?


SamGrady
Guest
Quote
2023-11-06 14:33:23

Of course, please take a couple of minutes to write an extension for improved usability.


chrisz
Registered User
Quote
2023-11-06 15:02:53

Don't make it more complicated as it is.

Make a texture and show it. Or did you want to make a real mirror for a car game or Fighter Jet Simulation?


SamGrady
Guest
Quote
2023-11-06 15:39:34

Here it is, this action doesn't perform optimally (as ccbRenderToTexture at all), but you can still use it. Please keep in mind that adding more mirrors may result in reduced performance.
https://samgrady.itch.io/copperc...


SamGrady
Guest
Quote
2023-11-06 15:48:35

Inside the demo, I demonstrate how to use this action and create two planes to showcase a particular issue you might encounter, which is the flipped polygons with the default plainMesh.

Within the action, you'll find four parameters:

1."MirrorSurface" - the mesh node for the mirror, where the reflection from the camera is rendered.
2."Camera" - the camera node used to capture the view rendered onto the mesh.
3."ReflectionQuality" - controls the resolution of the image rendered on the mesh.
4."MaterialIndex" - specifies the index of the material for rendering on the mesh.

I hope you find this action useful and enjoy using it!


SamGrady
Guest
Quote
2023-11-06 15:53:43

I am considering creating the next version based on the 'On proximity do something' approach, which would draw reflections only when you are close enough to the mirror and stop doing so when you are not. But for now, feel free to use and experiment with this version.


andgameplay
Registered User
Quote
2023-11-06 18:09:30

Very cool extension, thanks Sam!

Another possibility is to use the water mesh reflexion how mirror, just need adjust the parameters, you could try too!


luposian
Registered User
Quote
2023-11-07 03:49:16

SamGrady wrote:
It looks like this:
🔎︎

But doesn't that only show a static object view, like the cube in the mirror. If you controlled the cube, would it accurately reflect where (and/or how close) it was in relation to the mirror, just like a real mirror would? That's what I'm trying to achieve. Not just the "effect" of a mirror, but the actual properties of a mirror, accurately reflecting something being moved in front of it in real time.

UPDATE: I downloaded your code example and what I'm trying to achieve may actually be happening. I'll experiment more after dinner.


luposian
Registered User
Quote
2023-11-07 08:40:39

Why are there two cameras (one of them named mirror_flip)? You don't NEED two planes and two cameras, do you? I only need one of them (1 mirror) for the end of Stage 3 in my game.


SamGrady
Guest
Quote
2023-11-07 09:38:39

Why are there two cameras (one of them named mirror_flip)?

On using the standard plane, the image is projected inverted from left to right. To correct this, you'll need a mesh flip.


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "?nternational" (you are not logged in)


Text:

 

  

Possible Codes


Feature Code
Link [url] www.example.com [/url]
Bold [b]bold text[/b]
Image [img]http://www.example.com/image.jpg[/img]
Quote [quote]quoted text[/quote]
Code [code]source code[/code]

Emoticons


   






Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact