Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/docs/client-mdx-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Align, Light, Anim, Camera, Collision, GSplat, Script, Render, RigidBod

import ReactQueryProvider from '@docs-components/ReactQueryProvider'

import EnvAtlasComponent from '@components/EnvAtlas'
import EnvironmentLighting from '@/components/EnvironmentLighting'
import Grid from '@components/Grid'
import PostEffects, { StaticPostEffects} from '@components/PostEffects'
import ShadowCatcher from '@components/ShadowCatcher'
Expand All @@ -23,7 +23,7 @@ export const defaultComponents = {
Entity,
Align, Anim, Camera, Collision, GSplat, Script, Render, RigidBody, Light, Environment,
OrbitControls,
EnvAtlasComponent,
EnvironmentLighting,
Grid,
ShadowCatcher,
PostEffects,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import React, { FC, ComponentProps } from "react";
import { useEnvAtlas } from "./hooks/use-asset";
import { Environment } from "@playcanvas/react/components";

type EnvAtlasComponentsProps = ComponentProps<typeof Environment> & {
src: string;
type EnvironmentLightingProps = ComponentProps<typeof Environment> & {
src?: string;
intensity?: number;
}

const EnvAtlasComponent: FC<EnvAtlasComponentsProps> = ({
src,
const EnvironmentLighting: FC<EnvironmentLightingProps> = ({
src = '/environment-map.png',
intensity = 1,
...props
}) => {
Expand All @@ -21,4 +21,4 @@ type EnvAtlasComponentsProps = ComponentProps<typeof Environment> & {

}

export default EnvAtlasComponent;
export default EnvironmentLighting;
4 changes: 2 additions & 2 deletions packages/docs/content/docs/guide/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Here's what it should look like...
<ReactQueryProvider>
<Application >
{/* Create some environment lighting */}
<EnvAtlasComponent src='/environment-map.png' intensity={0.8}/>
<EnvironmentLighting intensity={0.8}/>
{/* Render the background grid */}
<Grid />
{/* Add a shadow catcher to catch the shadows from the model */}
Expand Down Expand Up @@ -183,7 +183,7 @@ import { OrbitControls } from '@playcanvas/react/scripts'
export default function App() {
return <Application>
{/* Create some environment lighting */}
<EnvAtlasComponent src='/environment-map.png' />
<EnvironmentLighting/>
{/* Render the background grid */}
<Grid />
{/* Add a shadow catcher to catch the shadows from the model */}
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/examples/environment.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const Example = () => {
return (<Entity>
{/* Create some environment lighting */}
<Environment
type="dome"
type="dome"
envAtlas={envAtlas}
skybox={skybox}
exposure={0.75}
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/examples/hello-world.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const HelloWorld = () => {
return <Entity>

{/* Add an environment atlas to the scene */}
<EnvAtlasComponent src='/environment-map.png'/>
<EnvironmentLighting />

{/* Render the background grid */}
<Grid />
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/content/examples/load-a-3D-model.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ export const LoadingGLB = () => {
if(!asset) return null;

return <Entity>

<EnvAtlasComponent src='/environment-map.png' intensity={2}/>
{/* Create some environment lighting */}
<EnvironmentLighting intensity={2}/>

{/* Render the background grid */}
<Grid />
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/examples/model-viewer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const ModelViewer = () => {

return (<Entity>
{/* Create some environment lighting */}
<EnvAtlasComponent src='/environment-map.png' />
<EnvironmentLighting />

{/* Render the background grid */}
<Grid />
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/examples/motion.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const Example = () => {
</Entity>

{/* Create some environment lighting */}
<EnvAtlasComponent src='/environment-map.png' intensity={0.4}/>
<EnvironmentLighting intensity={0.4}/>

{/* Create some additional lighting */}
<Entity rotation={[0, -45, 23]}>
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/examples/physics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const Physics = () => {

return (<Entity>

<EnvAtlasComponent src='/environment-map.png' />
<EnvironmentLighting/>

{/* Create a camera */}
<Entity name='camera' position={[0, 0, 20]} >
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/content/examples/pointer-events.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const PointerEvents = () => {

return <Entity>

<EnvAtlasComponent src='/environment-map.png' intensity={2}/>
<EnvironmentLighting intensity={2}/>

{/* Render the background grid */}
<Grid />
Expand Down
5 changes: 1 addition & 4 deletions packages/docs/content/examples/scripting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@ export const Demo = () => {
/**
* A simple glb viewer with a shadow catcher and auto rotate.
*/

const { data: asset } = useModel('/lamborghini_vision_gt.glb')

return (<Entity>
{/* Create some environment lighting */}
<EnvAtlasComponent src='/environment-map.png' />
{/* Render the background grid */}
<EnvironmentLighting/>

{/* Create a camera entity */}
<Entity name='camera' position={[4, 1, 4]}>
<Camera renderSceneColorMap={true} />
<OrbitControls inertiaFactor={0.07} distanceMin={6} distanceMax={10} pitchAngleMin={1} pitchAngleMax={90}/>

</Entity>

<Entity scale={[0.5, 0.5, 0.5]}>
Expand Down
3 changes: 0 additions & 3 deletions packages/docs/content/examples/splats.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ export const Example = () => {
const { data: splat } = useSplat(splatURL);

return <Entity>
{/* Create a camera entity */}
<EnvAtlasComponent src='/environment-map.png' />

<Entity>
<Camera fov={30} />
{ splat && <OrbitControls
Expand Down
Loading