Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Fix css for lightmap baking parameters #7894

Merged
merged 1 commit into from
Apr 13, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ModelComponent } from '@etherealengine/engine/src/scene/components/Mode
import { useHookstate } from '@etherealengine/hyperflux'
import { State } from '@etherealengine/hyperflux/functions/StateFunctions'

import { Typography } from '@mui/material'
import { Grid, Typography } from '@mui/material'

import { bakeLightmaps } from '../../lightmapper/lightmap'
import { WorkbenchSettings } from '../../lightmapper/workbench'
Expand Down Expand Up @@ -73,23 +73,49 @@ export default function LightmapBakerProperties({
bounceMultiplier: { ...FloatArg, default: 1 },
emissiveMultiplier: { ...FloatArg, default: 1 },
lightMapSize: { ...FloatArg, default: 1024 },
texelsPerUnit: { ...FloatArg, default: 16 },
samplerSettings: {
...ObjectArg,
default: {
targetSize: { ...FloatArg, default: 64 },
offset: FloatArg,
near: { ...FloatArg, default: 0.05 },
far: { ...FloatArg, default: 50 }
}
}
texelsPerUnit: { ...FloatArg, default: 16 }
}}
onChange={(k: keyof WorkbenchSettings) => {
return (val) => {
bakeProperties[k].set(val)
}
}}
/>
<Grid
container
spacing={2}
style={{
alignItems: 'center',
justifyContent: 'flex-end',
outline: 'solid 1px #fff',
borderRadius: '0.5rem',
paddingBottom: '1rem',
width: 'auto',
margin: '1rem',
overflow: 'overlay'
}}
>
<Grid item xs={2}>
<Typography variant="subtitle1">Sampler Settings</Typography>
</Grid>
<Grid item xs>
<ParameterInput
entity={modelState.src.value}
values={bakeProperties.samplerSettings.value ?? {}}
defaults={{
targetSize: { ...FloatArg, default: 64 },
offset: FloatArg,
near: { ...FloatArg, default: 0.05 },
far: { ...FloatArg, default: 50 }
}}
onChange={(k: string) => {
return (val) => {
bakeProperties.samplerSettings[k].set(val)
}
}}
/>
</Grid>
</Grid>
</Well>
{!baking.value && <Button onClick={doLightmapBake}>Bake Lightmaps</Button>}
{baking.value && <Typography variant="subtitle1">Baking...</Typography>}
Expand Down