virtual-puppet-project / vpuppr

VTuber application made with Godot 4
Mozilla Public License 2.0
741 stars 61 forks source link

[Feature Request] Chromakey backgrounds #4

Closed ItsRogueRen closed 3 years ago

ItsRogueRen commented 3 years ago

Could there be a button to add a chromakay-able background (Green, Magenta, and Cyan)? Running on a *nix OS makes stuff like OBS's Game Capture not possible (with the exception of Linux running WayLand instead of X11 and using an AMD GPU with an OBS plugin) so having and option to toggle those 3 colors should allow chromakeying of almost anything.

you-win commented 3 years ago

Yes, my current plan is to have some sort of popup menu under the Features tab to allow for all sorts of custom things.

If you are feeling adventurous, you can add the chroma key to the ModelDisplayScreen.tscn for your own use. There is actually a chromakey asset called ChromaKeySprite.tscn under the entities folder that I was using until I switched to the clear background.

ItsRogueRen commented 3 years ago

Yes, my current plan is to have some sort of popup menu under the Features tab to allow for all sorts of custom things.

If you are feeling adventurous, you can add the chroma key to the ModelDisplayScreen.tscn for your own use. There is actually a chromakey asset called ChromaKeySprite.tscn under the entities folder that I was using until I switched to the clear background.

How would I go about that? I saw the file but I have never used Godot outside of compiling this program

you-win commented 3 years ago

So ignore some of the names in my initial comment and follow these instructions instead.

  1. Open MainScreen.tscn in the editor.
  2. Right click on the MainScreen node in the top left
  3. Click on Instance Child Scene
  4. Search for ChromaKeySprite and select the only result. The chroma key should pop up
  5. Click on the new ChromaKeySprite node in the top left
  6. Some options should pop up on the far right. Open the Transform menu (located under Spatial)
  7. I would set the Translation to x: 0, y: 0, z: -5 and the Scale to x: 10, y: 10, z: 10 to be safe but you can tweak those to your liking

If you did everything correctly, you should get something like this: Untitled

I used the standard chromakey green hex I found on Google but you can pretty easily change the color by opening ChromaKeySprite.tscn (located in the entities folder), selecting the node in the top left, and then changing the texture to something different.

ItsRogueRen commented 3 years ago
4\. `ChromaKeySprite`

I don't have ChromaKeySprite

image

you-win commented 3 years ago

You need to select Instance Child Scene not Add Child Node.

Also, when exporting the project, you should select Export all resources in the project to make it easy. Untitled

you-win commented 3 years ago

Closed by 0.5.0 release. Create a chromakey image and load it in as a custom prop.