Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change the background? #40

Open
TannerGilbert opened this issue Nov 2, 2020 · 2 comments
Open

How to change the background? #40

TannerGilbert opened this issue Nov 2, 2020 · 2 comments

Comments

@TannerGilbert
Copy link

I added my own 3d models as described in CreatingAssets.md. Now I want to change the background images and remove the background objects. I tried setting the BackgroundObjectResourcesDirectory attribute to "" and set the BackgroundImageResourcesDirectory to a folder with some background images inside, but now the background is just blue and there sometimes are also some objects in the background.

@SCRktkt
Copy link
Contributor

SCRktkt commented Nov 2, 2020

Tanner,
You can swap assets in the Background folder and images in the GrocertyStoreDataset folder, or retarget those directories in the Project Initialization Script. However, the background objects themselves are ones we made specially for this project and are referenced in the ProjectInitialization and Background scripts. Hence, they cannot be swapped for standard 3d assets without a bit of script work; those scripts reference the material on the background objects and load the images in. As for the blue background, that is the color of the sky, which can be changed in the Main Camera.

@mkamalza
Copy link
Collaborator

mkamalza commented Jul 30, 2021

The latest version of the project in the master branch uses a new method for instantiating background objects. Please have a look at this page for an overview on how the new project works. It is less complex and easier to customize than before.

In short, SynthDet's backgrounds are created in two steps. First, a bunch of primitive shapes are created, and then the textures and hue offsets of those shapes are randomized.

If you look at the object named "Scenario" in the "SynthDet" Scene, you will see a list of Randomizers, each of which is tasked with randomizing one or more aspects of the environment.

The two Randomizers expanded below are the ones that create and then texture the background objects. To remove the background, you can just disable the first one, named BackgroundObjectPlacementRandomizer. To put different textures on the background objects, you can modify the list of textures in TextureRandomizer. Similarly, the Randomizer named ForegroundObjectPlacementRandomizer is the one responsible for creating and placing foreground objects, so that is where would use the 3D models you used. Make sure you convert your models to Prefabs before adding them to the Randomizer though.

Hope that was helpful. Please keep us updated on your progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants