Skip to content

Commit 189488f

Browse files
authored
Merge pull request #42 from Chylum/docs/spawn-networked-props-from-scene-button
Documentation: Add guide on how to add props using a scene button
2 parents 4880d06 + ed92bc5 commit 189488f

14 files changed

Lines changed: 94 additions & 1 deletion

File tree

content/docs/avatar/shaders.mdx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,28 @@ import { Callout } from 'fumadocs-ui/components/callout';
3939
<Callout type="info">
4040
These are known to be working/compatible at the time of the latest documentation update.
4141
</Callout>
42+
43+
44+
## How to Make Avatars Which Use Poiyomi Shaders Work in BasisVR/URP
45+
46+
Many avatars use Poiyomi shaders which originally only worked with Unity's Built-in Render Pipeline (BIRP). However, now, Poiyomi shaders are also supported to work with Unity's Universal Render Pipeline (URP), which is the render pipeline used for BasisVR.
47+
48+
Poiyomi shaders support for URP is still in beta. If you have an avatar that was originally designed using BIRP Poiyomi shaders, you can easily convert them to be URP-compatible by following the steps below. To demonstrate how, this example uses uses [Hatsune Miku by Tomarudo](https://boothplorer.com/avatar/3226395).
49+
50+
- Download the latest release from https://discord.gg/poiyomi #urp-release.
51+
52+
- Import your character into the Unity scene. If it the shader looks different from what's expected (e.g., its colours are missing or it has a magenta colour due to missing shaders or similar), you will need to make just a few tiny adjustments to fix things.
53+
54+
![Inspector Window showing button and components](/img/avatars/23.png)
55+
56+
- Select each material in your avatar's folder and change its shader to use Poiyomi Pro URP.
57+
58+
![Inspector Window showing button and components](/img/avatars/24.png)
59+
60+
- After making the changes, your avatar should render as expected.
61+
62+
![Inspector Window showing button and components](/img/avatars/25.png)
63+
64+
<Callout type="info">
65+
Poiyomi shaders for URP is compatible with both PC and Android devices.
66+
</Callout>

content/docs/world/props.mdx

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,76 @@ You can find your key by opening up the Basis application and selecting your pla
117117

118118
- Ensure Persistent is selected so that synced changes persist for late-joining players.
119119

120+
- Click Save XML.
121+
120122
![Inspector Window for load config](/img/props/5B.png)
121123

122124
- Open up the 'Initialization' scene and press play. This initialises the created scene and network objects. The next time when you load the scene through the server while running the basis application, all players will be able to interact with the network synced cube.
123125

124-
![Desktop Steam two game windows showing synced cube](/img/props/5C.png)
126+
![Desktop Steam two game windows showing synced cube](/img/props/5C.png)
127+
128+
## How to Spawn a Prop Using a Scene button
129+
130+
The Runtime Loader component will generate any props located in *Basis\Basis Server\BasisServerConsole\bin\Debug\net9.0\initialresources* at runtime. It is also possible to use a button with a scene to generate props. To do so:
131+
132+
- Add a canvas object to your scene. Make sure to attach the relevant components similar to what was shown in the previous sections. Remember to add a Basis Prop component to generate a .bee file for your prop and upload it to a remote server.
133+
134+
![Inspector Window showing canvas and components](/img/props/6A.png)
135+
136+
- Create a TMP button.
137+
138+
![Inspector Window showing button and components](/img/props/6B.png)
139+
140+
- Add a Basis Prop component, enter an Asset Bundle Name and press the 'Create Prop Bee File' button. The generated .bee files will be used by the Basis Runtime Loader to load the prop into a scene. For this example, we will use the network synced cube from the previous section again.
141+
142+
![Inspector Window showing synced cube and components](/img/props/6B-.png)
143+
144+
- Create an empty Gameobject and attach a Runtime Loader component to it. This will be used to spawn the prop. To avoid props being generated on scene start up, disable the component in the inspector.
145+
146+
![Inspector Window showing Runtime Loader which is disabled](/img/props/6C.png)
147+
148+
<Callout type="info">
149+
If you want your prop to be network synced, add a networking syncing component to it. For instance, you can use the Basis Object Network Syncing component, as shown previously, to synchronise prop movement.
150+
151+
You can also create your own network syncing code. For inspiration and to help you get started, you can refer to example packages *Basis Ported Pooltable* and *Basis Vehicles* which you can find inside the project.
152+
</Callout>
153+
154+
- Select your button and add an onClick() event to it. Assign your Runtime Loader Gameobject, making sure to select BasisRuntimeLoader.LoadNow as the method which your button will call on when clicked.
155+
156+
![Inspector Window showing button event calling RuntimeLoader](/img/props/6D.png)
157+
158+
- Open up the Load Config editor.
159+
160+
- Enter your generated prop password and .bee url.
161+
162+
- Ensure Persistent is selected so that synced changes persist for late-joining players.
163+
164+
- Click Save XML.
165+
166+
![Inspector Window showing load config](/img/props/6E.png)
167+
168+
- If you haven't already, create an empty Gamebject and attach a Basis Scene component to it, filling in the relevant fields. Once set, click 'Create Scene Bee File'.
169+
170+
![Inspector Window showing Basis scene](/img/props/6F.png)
171+
172+
- Open up the Load Config editor again.
173+
174+
- Enter your generated scene password and .bee url.
175+
176+
- Ensure Persistent is selected so that synced changes persist for late-joining players.
177+
178+
- Click Save XML.
179+
180+
![Inspector Window showing button and components](/img/props/6G.png)
181+
182+
- Open up the 'Initialization' scene and press play. This initialises the created scene and network objects. The next time when you load the scene through the server while running the basis application, you should be able to spawn your prop via a button.
183+
184+
![Inspector Window showing button and components](/img/props/6H.png)
185+
186+
<Callout type="info">
187+
Note: Both local and remote players can spawn cubes!
188+
</Callout>
189+
190+
<Callout type="info">
191+
Double note: You can access Basis VR via Steam as well. To get an access key, [join the discord](https://discord.gg/v6ve6WT562)!
192+
</Callout>

public/img/avatars/23.png

167 KB
Loading

public/img/avatars/24.png

116 KB
Loading

public/img/avatars/25.png

292 KB
Loading

public/img/props/6A.png

80.5 KB
Loading

public/img/props/6B-.png

179 KB
Loading

public/img/props/6B.png

67.8 KB
Loading

public/img/props/6C.png

54.4 KB
Loading

public/img/props/6D.png

7.35 KB
Loading

0 commit comments

Comments
 (0)