Skip to content

Commit

Permalink
update: Asset relative locations
Browse files Browse the repository at this point in the history
  • Loading branch information
brianzinn committed Aug 26, 2023
1 parent fe7553f commit 69785bc
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 16 deletions.
4 changes: 2 additions & 2 deletions packages/static/content/examples/basic/assign-to/AssignTo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ export const FromInstance = () => (
useRoughnessFromMetallicTextureGreen
useMetallnessFromMetallicTextureBlue
>
<texture url="../../assets/textures/mr.jpg" assignTo="metallicTexture" />
<texture url="../../../assets/textures/mr.jpg" assignTo="metallicTexture" />
</pbrMaterial>
</sphere>
<cubeTexture
level={0.5}
assignTo="environmentTexture"
rootUrl="../../assets/textures/environment.env"
rootUrl="../../../assets/textures/environment.env"
/>
</Scene>
</Engine>
Expand Down
4 changes: 2 additions & 2 deletions packages/static/content/examples/gui/skybox-3d/Skybox3D.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import { Engine, Scene, Skybox } from 'react-babylonjs'
const SkyboxScenes = [
{
name: 'sunny day',
texture: `../../assets/textures/TropicalSunnyDay`,
texture: `../../../assets/textures/TropicalSunnyDay`,
},
{
name: 'specular HDR',
texture: `../../assets/textures/SpecularHDR.dds`,
texture: `../../../assets/textures/SpecularHDR.dds`,
},
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Engine, Scene, Task, TaskType, useAssetManager, useBeforeRender } from
const pointCloudAssets: Task[] = [
{
taskType: TaskType.Binary,
url: '../../assets/kitti/000000.bin',
url: '../../../assets/kitti/000000.bin',
name: 'Velodyne-kitt-dataset',
},
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const ColorGrading = () => {
<SkyboxAndSphere />
<colorGradingTexture
ref={colorGradingTextureRef}
url="../../assets/textures/LateSunset.3dl"
url="../../../assets/textures/LateSunset.3dl"
/>
</Scene>
</Engine>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { Engine, Scene, Skybox } from 'react-babylonjs'
* Insipration Playground: https://www.babylonjs-playground.com/#AQZJ4C#0
*/
const WithFresnelParameters = () => {
let sunnyDayRootUrl = '../../assets/textures/TropicalSunnyDay'
let sunnyDayRootUrl = '../../../assets/textures/TropicalSunnyDay'
let pointLightRef = useRef<PointLight | null>(null)

const [pointLightDiffuse, setPointLightDiffuse] = useState(() => new Color3(1, 0.5, 0.5))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ const textureAssets: Task[] = [
},
{
taskType: TaskType.Texture,
url: '../../assets/textures/grass.png',
url: '../../../assets/textures/grass.png',
name: 'grass',
},
{
taskType: TaskType.Texture,
url: '../../assets/textures/bump.png',
url: '../../../assets/textures/bump.png',
name: 'bump',
},
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type DynamicConfigProps = {
* Official Demo: https://www.babylonjs.com/demos/pbr/
*/
const WithDynamicConfig: FC<DynamicConfigProps> = ({ roughness }) => {
let environmentUrl = '../../assets/textures/environment.dds'
let environmentUrl = '../../../assets/textures/environment.dds'
const [_, setTexturesLoaded] = useState(false)

const cubeTextureRef = useRef<CubeTexture | undefined>(undefined)
Expand Down Expand Up @@ -128,8 +128,8 @@ const WithDynamicConfig: FC<DynamicConfigProps> = ({ roughness }) => {
albedoColor={Color3.White()}
useMicroSurfaceFromReflectivityMapAlpha
>
<texture url="../../assets/textures/reflectivity.png" assignTo="reflectivityTexture" />
<texture url="../../assets/textures/albedo.png" assignTo="albedoTexture" />
<texture url="../../../assets/textures/reflectivity.png" assignTo="reflectivityTexture" />
<texture url="../../../assets/textures/albedo.png" assignTo="albedoTexture" />
<pbrClearCoatConfiguration assignFrom="clearCoat" isEnabled roughness={roughness} />
</pbrMaterial>
</box>
Expand Down
9 changes: 6 additions & 3 deletions packages/static/content/examples/textures/pbr/PBR.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { Engine, Scene } from 'react-babylonjs'
* Official Demo: https://www.babylonjs.com/demos/pbr/
*/
const WithPBR = () => {
let environmentUrl = '../../assets/textures/environment.dds'
let environmentUrl = '../../../assets/textures/environment.dds'

const [_, setTexturesLoaded] = useState(false)
const cubeTextureRef = useRef<CubeTexture | undefined>(undefined)
Expand Down Expand Up @@ -140,8 +140,11 @@ const WithPBR = () => {
albedoColor={Color3.White()}
useMicroSurfaceFromReflectivityMapAlpha
>
<texture url="../../assets/textures/reflectivity.png" assignTo="reflectivityTexture" />
<texture url="../../assets/textures/albedo.png" assignTo="albedoTexture" />
<texture
url="../../../assets/textures/reflectivity.png"
assignTo="reflectivityTexture"
/>
<texture url="../../../assets/textures/albedo.png" assignTo="albedoTexture" />
</pbrMaterial>
</box>
</Scene>
Expand Down
2 changes: 1 addition & 1 deletion packages/static/content/examples/textures/pbr/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Physical Based Rendering - accomplished here with PBRMaterial.
<box name="plane" width={65} height={1} depth={65}>
<pbrMaterial reflectionTexture={cubeTextureRef.current}>
<texture
url="../../assets/textures/reflectivity.png"
url="../../../assets/textures/reflectivity.png"
assignTo="reflectivityTexture"
/>
</pbrMaterial>
Expand Down

0 comments on commit 69785bc

Please sign in to comment.