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

feat: 331 new context for state tino #340

Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
2c75b36
feat: refactored composables; seperated logic from TresCanvas
Tinoooo Jul 4, 2023
42ea2a2
chore: more changes concerning renderer composable
Tinoooo Jul 5, 2023
c42feba
feat: made window size reactive
Tinoooo Jul 5, 2023
e36f26d
chore: made compasable params more uniform
Tinoooo Jul 5, 2023
c526094
chore: refactored useRenderer
Tinoooo Jul 5, 2023
2b70524
chore: type cleanup
Tinoooo Jul 5, 2023
82a60e7
feat: added user data key for active cameras
Tinoooo Jul 5, 2023
cd3037e
feat: made renderer constructor params reactive
Tinoooo Jul 6, 2023
b4a1701
feat: made multiple cameras work
Tinoooo Jul 6, 2023
929fb8e
feat: made camera handling work properly and fixed event handler problem
Tinoooo Jul 6, 2023
c4d4764
feat: added option to set a camera active by it's uuid and the object…
Tinoooo Jul 6, 2023
13332ad
chore: moved composable to composables
Tinoooo Jul 6, 2023
ce86775
chore: removed obsolete todo comments
Tinoooo Jul 6, 2023
80d4222
chore: set antialias to be true by default in TresCanvas
Tinoooo Jul 6, 2023
1e5fb55
chore: fix debugUI playground
alvarosabu Jul 7, 2023
528b6f6
chore: pnpm lock
alvarosabu Jul 7, 2023
2e741c1
chore: added localOrbitControls
alvarosabu Jul 7, 2023
a7c0ada
chore: made render loop start initially
Tinoooo Jul 7, 2023
92f7c5c
chore: changes concerning PR review
Tinoooo Jul 7, 2023
a9f64d4
chore: changes concerning PR review
Tinoooo Jul 7, 2023
9dda3e9
Merge branch 'feature/331-new-context-for-state__tino' of github.com:…
alvarosabu Jul 7, 2023
fb9268e
chore: remove camera test for now
alvarosabu Jul 7, 2023
c968f25
chore: release v2.4.0-next.4
alvarosabu Jul 7, 2023
9f521fb
chore: ci update for pnpm actions
alvarosabu Jul 10, 2023
00d07a7
Merge branch 'main' into feature/331-new-context-for-state__tino
alvarosabu Jul 10, 2023
f613018
chore: correct typo on test action name
alvarosabu Jul 10, 2023
0636411
Merge branch 'main' into feature/331-new-context-for-state__tino
alvarosabu Jul 10, 2023
b3c0455
chore: restored reactivity of renderer composable
Tinoooo Jul 18, 2023
f0cf8a9
chore: replaced userData handling in keys.ts by types
Tinoooo Jul 18, 2023
5dbddf6
chore: made tests temporarily work
Tinoooo Jul 18, 2023
2220bc5
chore: disabled test temporarily
Tinoooo Jul 18, 2023
e986b30
chore: removed readonly on scene for post-processing
Tinoooo Jul 19, 2023
e754f1c
chore: release v2.4.0-next.5
alvarosabu Jul 19, 2023
5ae169a
chore: restored readonly on scene and removed it from renderer
Tinoooo Jul 19, 2023
2d0c75f
chore: release v2.4.0-next.6
alvarosabu Jul 19, 2023
59e5d31
chore: fixed hmr
Tinoooo Jul 20, 2023
b45d5a1
chore: made usePointerEventHandler more uniform to other composables
Tinoooo Jul 20, 2023
225c828
feat: made renderer presets have less priority than explicitly define…
Tinoooo Jul 20, 2023
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
28 changes: 14 additions & 14 deletions docs/api/renderer.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,20 @@ renderer.shadowMap.type: PCFSoftShadowMap

## Props

| Prop | Description | Default |
| :-------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
| **shadows** | Enable shadows in the Renderer | `false` |
| **shadowMapType** | Set the shadow map type | `PCFSoftShadowMap` |
| **physicallyCorrectLights** | Whether to use physically correct lighting mode. See the [lights / physical example](https://threejs.org/examples/#webgl_lights_physical). | `false` |
| **outputColorSpace** | Defines the output encoding | `LinearEncoding` |
| **toneMapping** | Defines the tone mapping exposure used by the renderer. | `NoToneMapping` |
| **context** | This can be used to attach the renderer to an existing [RenderingContext](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext) | |
| **powerPreference** | Provides a hint to the user agent indicating what configuration of GPU is suitable for this WebGL context. Can be "high-performance", "low-power" or "default". | `default` |
| **preserveDrawingBuffer** | Whether to preserve the buffers until manually cleared or overwritten.. | `false` |
| **clearColor** | The color the renderer will use to clear the canvas. | `#000000` |
| **windowSize** | Whether to use the window size as the canvas size or the parent element. | `false` |
| **disableRender** | Disable render on requestAnimationFrame, usefull for PostProcessing | `false` |
| **camera** | A manual camera to be used by the renderer. | |
| Prop | Description | Default |
| :------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
| **shadows** | Enable shadows in the Renderer | `false` |
| **shadowMapType** | Set the shadow map type | `PCFSoftShadowMap` |
| **useLegacyLights** | Whether to use the legacy lighting mode or not | `true` |
| **outputColorSpace** | Defines the output encoding | `LinearEncoding` |
| **toneMapping** | Defines the tone mapping exposure used by the renderer. | `NoToneMapping` |
| **context** | This can be used to attach the renderer to an existing [RenderingContext](https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext) | |
| **powerPreference** | Provides a hint to the user agent indicating what configuration of GPU is suitable for this WebGL context. Can be "high-performance", "low-power" or "default". | `default` |
| **preserveDrawingBuffer** | Whether to preserve the buffers until manually cleared or overwritten.. | `false` |
| **clearColor** | The color the renderer will use to clear the canvas. | `#000000` |
| **windowSize** | Whether to use the window size as the canvas size or the parent element. | `false` |
| **disableRender** | Disable render on requestAnimationFrame, usefull for PostProcessing | `false` |
| **camera** | A manual camera to be used by the renderer. | |

## Defaults

Expand Down
2 changes: 2 additions & 0 deletions playground/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export {}
declare module 'vue' {
export interface GlobalComponents {
AnimatedModel: typeof import('./src/components/AnimatedModel.vue')['default']
CameraOperator: typeof import('./src/components/CameraOperator.vue')['default']
Cameras: typeof import('./src/components/Cameras.vue')['default']
copy: typeof import('./src/components/TheBasic copy.vue')['default']
DanielTest: typeof import('./src/components/DanielTest.vue')['default']
Expand All @@ -25,6 +26,7 @@ declare module 'vue' {
TestSphere: typeof import('./src/components/TestSphere.vue')['default']
Text3D: typeof import('./src/components/Text3D.vue')['default']
TheBasic: typeof import('./src/components/TheBasic.vue')['default']
TheCameraOperator: typeof import('./src/components/TheCameraOperator.vue')['default']
TheConditional: typeof import('./src/components/TheConditional.vue')['default']
TheEnvironment: typeof import('./src/components/TheEnvironment.vue')['default']
TheEvents: typeof import('./src/components/TheEvents.vue')['default']
Expand Down
10 changes: 5 additions & 5 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
},
"dependencies": {
"@tresjs/cientos": "2.1.4",
"@tresjs/core": "workspace:2.4.0-next.2",
"vue-router": "^4.2.2"
"@tresjs/core": "workspace:2.4.0-next.3",
"vue-router": "^4.2.4"
},
"devDependencies": {
"@tresjs/leches": "^0.3.1",
"unplugin-auto-import": "^0.16.4",
"@tresjs/leches": "^0.4.0",
"unplugin-auto-import": "^0.16.6",
"vite-plugin-glsl": "^1.1.2",
"vue-tsc": "^1.8.1"
"vue-tsc": "^1.8.4"
}
}
28 changes: 13 additions & 15 deletions playground/src/components/DebugUI.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,32 @@
import { TresCanvas } from '@tresjs/core'
import { BasicShadowMap, SRGBColorSpace, NoToneMapping } from 'three'

import { OrbitControls, Box } from '@tresjs/cientos'
import { TresLeches, useControls } from '@tresjs/leches'
import '@tresjs/leches/styles'
// import { OrbitControls, Box } from '@tresjs/cientos'
/* import { TresLeches, useControls } from '@tresjs/leches' */
/* import '@tresjs/leches/styles' */

const gl = {
const gl = reactive({
clearColor: '#82DBC5',
shadows: true,
alpha: false,
shadowMapType: BasicShadowMap,
outputColorSpace: SRGBColorSpace,
toneMapping: NoToneMapping,
}
})

const boxPosition = ref([0, 0.5, 0])

useControls(gl)
useControls('Box', boxPosition.value)
/* useControls('fpsgraph') */
// useControls(gl)
// useControls('Box', boxPosition.value)

</script>

<template>
<TresLeches />
<TresCanvas v-bind="gl" :window-size="true">
<TresPerspectiveCamera :position="[3, 3, 3]" :look-at="[0, 0, 0]" />
<!-- <OrbitControls /> -->
<Box :position-x="boxPosition[0]">
<TresMeshNormalMaterial />
</Box>
<TresPerspectiveCamera :look-at="[0, 4, 0]" />
<TresMesh :position="[0, 4, 0]">
<TresBoxGeometry :args="[1, 1, 1]" />
<TresMeshToonMaterial color="teal" />
</TresMesh>
<TresGridHelper />
<TresAmbientLight :intensity="1" />
</TresCanvas>
Expand Down
Loading