Ambiera Forum

Discussions, Help and Support.

Ambiera Forum > CopperCube > Help with CopperCube
How to render a camera output onto a 3d surface.

mostock
Registered User
Quote
2022-12-26 22:01:03

This my first CCB thread.
I'm working on a new FPS game and, I want to add the ability to player to inspect deferent map areas via Camera Control displaying output onto a monitor 3d model.

So I want to render a camera (camera control) output onto a 3d surface (monitor 3d model).

thanks in advance.


Guest
Guest
Quote
2022-12-26 22:23:21

You will need a custom shader to display it on the model itself. I believe Just_In_Case is including that in the next CC update which should be out soon. Might be wrong, however. You can try doing it the old-fashioned way by taking a screenshot of the area that camera is facing and using that as a texture on the screen. Then when the player interacts with the screen you can switch the FPS camera to another camera that looks over the area. Many games before have used that technique. Should be fairly simple to implement. The other alternative is waiting for the update.


mostock
Registered User
Quote
2022-12-26 23:05:20

Good Idea Bro! Thanks a lot.

But this will not work for my case, because I want it to be in real-time, to help players spy on enemies movements and be able to rotate the camera.
This will work if cameras is static and nothing move in front of it.

So any one have another solution, please.


VP
Guest
Quote
2022-12-27 11:58:15

You could also use a 2D plane childed to the monitor model's screen - then use transparency on the material's alpha-chanel to update the 2D plane, by changing it's texture.


VP
Guest
Quote
2022-12-27 12:14:28

I think what guest means is to have a bird's-eye-view camera above the scene (separate to the FPS camera) which see the entire map from above which takes screenshots, then renders the screen shot over the monitor model.

You can do this repeatedly with an "every 500 milliseconds" loop. To make it better, you can attach 2D planes above the players with red dots so the top camera can see the enemies as large red dots but the fps camera wont see the dot from underneath. You can also put a green transparency on a 2D plane, stretched over the entire map, to make it look more like a monitor output - only the top camera will see the green overlay and the red dots, as the textures are not double-sided by default.

There are other ways to do it too (for example - using "on proximity" nodes attached to the enemies which update the 2D scanner overlay with their current position). It's definitely possible (even without coding) I made a real-time scanner for my JungleTankRecue game - but I kept it really simple - just red dots - no map.


just_in_case
Moderator
Quote
2022-12-27 15:02:20

In the next update you can use the API command to render to texture....
You can also use the screenshot methods proposed by others but you probably need to save and load your screenshots with different names, every miliseconds... as everytime it loads the screenshot as a texture it will stay in the memory, so even if the image is changed it is going to stay in the same image.
so you probably need to change the name of the screenshot and load it with the new name. That way yoj can mimic a RTT trick.
if you want to render a new individual camera along eith your main camera, then you can also do that in the next upcoming update.


coa
Registered User
Quote
2022-12-27 18:54:32

really look forward to render to texture feature.
i will start by making a mirror for my game.


gree
Registered User
Quote
2023-01-01 20:33:26

@just_in_case: I understand that your mods are basically for *.exe exports. Do you think "render to texture feature" will still work on a WebGL export? Also looking forward to it...


Create reply:


Posted by: (you are not logged in)


Enter the missing letter in: "Internatio?al" (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