bx-1316-refactoring #14

Merged
ksenia_mikhailova merged 46 commits from bx-1316-refactoring into dev 2024-08-28 15:06:52 +03:00
7 changed files with 48 additions and 63 deletions
Showing only changes of commit 4f53c162ca - Show all commits

View File

@ -599,7 +599,7 @@
"kind": 5, "kind": 5,
"importPath": "back.back.settings", "importPath": "back.back.settings",
"description": "back.back.settings", "description": "back.back.settings",
"peekOfCode": "SECRET_KEY = \"django-insecure-ly8rk@zb&ne*-063&q-=81!d@8q0hh4$&q!_7mtqc81(rlejqd\"\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = True\nALLOWED_HOSTS = [\n \"localhost\",\n \"localhost:8000\",\n \"127.0.0.1\",\n \"127.0.0.1:8000\",\n \"192.168.103.159\",\n \"192.168.103.159:8000\",", "peekOfCode": "SECRET_KEY = \"django-insecure-ly8rk@zb&ne*-063&q-=81!d@8q0hh4$&q!_7mtqc81(rlejqd\"\n# SECURITY WARNING: don't run with debug turned on in production!\nDEBUG = True\nALLOWED_HOSTS = [\n \"localhost\",\n \"localhost:8000\",\n \"127.0.0.1\",\n \"127.0.0.1:8000\",\n \"192.168.106.234\",\n \"192.168.106.234:8000\",",
"detail": "back.back.settings", "detail": "back.back.settings",
"documentation": {} "documentation": {}
}, },
@ -608,7 +608,7 @@
"kind": 5, "kind": 5,
"importPath": "back.back.settings", "importPath": "back.back.settings",
"description": "back.back.settings", "description": "back.back.settings",
"peekOfCode": "DEBUG = True\nALLOWED_HOSTS = [\n \"localhost\",\n \"localhost:8000\",\n \"127.0.0.1\",\n \"127.0.0.1:8000\",\n \"192.168.103.159\",\n \"192.168.103.159:8000\",\n \"back\",\n \"back:8000\",", "peekOfCode": "DEBUG = True\nALLOWED_HOSTS = [\n \"localhost\",\n \"localhost:8000\",\n \"127.0.0.1\",\n \"127.0.0.1:8000\",\n \"192.168.106.234\",\n \"192.168.106.234:8000\",\n \"back\",\n \"back:8000\",",
"detail": "back.back.settings", "detail": "back.back.settings",
"documentation": {} "documentation": {}
}, },
@ -617,7 +617,7 @@
"kind": 5, "kind": 5,
"importPath": "back.back.settings", "importPath": "back.back.settings",
"description": "back.back.settings", "description": "back.back.settings",
"peekOfCode": "ALLOWED_HOSTS = [\n \"localhost\",\n \"localhost:8000\",\n \"127.0.0.1\",\n \"127.0.0.1:8000\",\n \"192.168.103.159\",\n \"192.168.103.159:8000\",\n \"back\",\n \"back:8000\",\n \"demo.kustarshina.ru\",", "peekOfCode": "ALLOWED_HOSTS = [\n \"localhost\",\n \"localhost:8000\",\n \"127.0.0.1\",\n \"127.0.0.1:8000\",\n \"192.168.106.234\",\n \"192.168.106.234:8000\",\n \"back\",\n \"back:8000\",\n \"demo.kustarshina.ru\",",
"detail": "back.back.settings", "detail": "back.back.settings",
"documentation": {} "documentation": {}
}, },
@ -626,7 +626,7 @@
"kind": 5, "kind": 5,
"importPath": "back.back.settings", "importPath": "back.back.settings",
"description": "back.back.settings", "description": "back.back.settings",
"peekOfCode": "CSRF_TRUSTED_ORIGINS = (\n \"https://demo.kustarshina.ru\",\n \"http://localhost\",\n \"http://localhost:3011\",\n \"http://localhost:4173\",\n \"http://localhost:5173\",\n \"http://192.168.103.159:3011\",\n \"http://192.168.103.159\",\n)\nCORS_ORIGIN_ALLOW_ALL = False", "peekOfCode": "CSRF_TRUSTED_ORIGINS = (\n \"https://demo.kustarshina.ru\",\n \"http://localhost\",\n \"http://localhost:3011\",\n \"http://localhost:4173\",\n \"http://localhost:5173\",\n \"http://192.168.106.234:3011\",\n \"http://192.168.106.234\",\n)\nCORS_ORIGIN_ALLOW_ALL = False",
"detail": "back.back.settings", "detail": "back.back.settings",
"documentation": {} "documentation": {}
}, },
@ -635,7 +635,7 @@
"kind": 5, "kind": 5,
"importPath": "back.back.settings", "importPath": "back.back.settings",
"description": "back.back.settings", "description": "back.back.settings",
"peekOfCode": "CORS_ORIGIN_ALLOW_ALL = False\nCORS_ORIGIN_WHITELIST = [\n \"null\",\n \"http://localhost\",\n \"http://localhost:3011\",\n \"http://localhost:4173\",\n \"http://localhost:5173\",\n \"http://localhost:8000\",\n \"http://192.168.103.159:3011\",\n \"http://127.0.0.1\",", "peekOfCode": "CORS_ORIGIN_ALLOW_ALL = False\nCORS_ORIGIN_WHITELIST = [\n \"null\",\n \"http://localhost\",\n \"http://localhost:3011\",\n \"http://localhost:4173\",\n \"http://localhost:5173\",\n \"http://localhost:8000\",\n \"http://127.0.0.1\",\n \"http://192.168.106.234\",",
"detail": "back.back.settings", "detail": "back.back.settings",
"documentation": {} "documentation": {}
}, },
@ -644,7 +644,7 @@
"kind": 5, "kind": 5,
"importPath": "back.back.settings", "importPath": "back.back.settings",
"description": "back.back.settings", "description": "back.back.settings",
"peekOfCode": "CORS_ORIGIN_WHITELIST = [\n \"null\",\n \"http://localhost\",\n \"http://localhost:3011\",\n \"http://localhost:4173\",\n \"http://localhost:5173\",\n \"http://localhost:8000\",\n \"http://192.168.103.159:3011\",\n \"http://127.0.0.1\",\n \"http://192.168.103.159\",", "peekOfCode": "CORS_ORIGIN_WHITELIST = [\n \"null\",\n \"http://localhost\",\n \"http://localhost:3011\",\n \"http://localhost:4173\",\n \"http://localhost:5173\",\n \"http://localhost:8000\",\n \"http://127.0.0.1\",\n \"http://192.168.106.234\",\n \"http://192.168.106.234:3011\",",
"detail": "back.back.settings", "detail": "back.back.settings",
"documentation": {} "documentation": {}
}, },

View File

@ -34,8 +34,8 @@ ALLOWED_HOSTS = [
"localhost:8000", "localhost:8000",
"127.0.0.1", "127.0.0.1",
"127.0.0.1:8000", "127.0.0.1:8000",
"192.168.103.159", "192.168.106.234",
"192.168.103.159:8000", "192.168.106.234:8000",
"back", "back",
"back:8000", "back:8000",
"demo.kustarshina.ru", "demo.kustarshina.ru",
@ -46,8 +46,8 @@ CSRF_TRUSTED_ORIGINS = (
"http://localhost:3011", "http://localhost:3011",
"http://localhost:4173", "http://localhost:4173",
"http://localhost:5173", "http://localhost:5173",
"http://192.168.103.159:3011", "http://192.168.106.234:3011",
"http://192.168.103.159", "http://192.168.106.234",
) )
CORS_ORIGIN_ALLOW_ALL = False CORS_ORIGIN_ALLOW_ALL = False
CORS_ORIGIN_WHITELIST = [ CORS_ORIGIN_WHITELIST = [
@ -57,12 +57,12 @@ CORS_ORIGIN_WHITELIST = [
"http://localhost:4173", "http://localhost:4173",
"http://localhost:5173", "http://localhost:5173",
"http://localhost:8000", "http://localhost:8000",
"http://192.168.103.159:3011",
"http://127.0.0.1", "http://127.0.0.1",
"http://192.168.103.159", "http://192.168.106.234",
"http://192.168.103.159:3000", "http://192.168.106.234:3011",
"http://192.168.103.159:5173", "http://192.168.106.234:3000",
"http://192.168.103.159:8000", "http://192.168.106.234:5173",
"http://192.168.106.234:8000",
"http://front:4173", "http://front:4173",
"http://front:5173", "http://front:5173",
"http://back:8000", "http://back:8000",

View File

@ -1,4 +1,4 @@
VITE_SERVER_URL='https://demo.kustarshina.ru' VITE_SERVER_URL='https://demo.kustarshina.ru'
VITE_IMAGE_URL='https://demo.kustarshina.ru' VITE_IMAGE_URL='https://demo.kustarshina.ru'
VITE_SERVER_URL='https://demo.kustarshina.ru' VITE_SERVER_URL='https://demo.kustarshina.ru'
VITE_SERVER_URL='http://localhost:8000' VITE_SERVER_URL='http://192.168.106.234:8000'

View File

@ -27,6 +27,7 @@ declare module 'vue' {
ModelItem: typeof import('./src/components/Promo/modelItem.vue')['default'] ModelItem: typeof import('./src/components/Promo/modelItem.vue')['default']
Models: typeof import('./src/components/Promo/models.vue')['default'] Models: typeof import('./src/components/Promo/models.vue')['default']
Post_pocessing: typeof import('./src/components/Promo/post_pocessing.vue')['default'] Post_pocessing: typeof import('./src/components/Promo/post_pocessing.vue')['default']
Post_processing: typeof import('./src/components/Promo/post_processing.vue')['default']
Projects: typeof import('./src/components/Projects.vue')['default'] Projects: typeof import('./src/components/Projects.vue')['default']
Promo: typeof import('./src/components/Promo/index.vue')['default'] Promo: typeof import('./src/components/Promo/index.vue')['default']
RandomIcon: typeof import('./src/components/RandomIcon.vue')['default'] RandomIcon: typeof import('./src/components/RandomIcon.vue')['default']

View File

@ -3,13 +3,14 @@ import { onMounted, onUnmounted, reactive, ref, watch } from 'vue';
import { import {
Box3, Color, DoubleSide, Group, Mesh, PlaneGeometry, Box3, Color, DoubleSide, Group, Mesh, PlaneGeometry,
MeshStandardMaterial, MeshStandardMaterialParameters, MeshStandardMaterial, MeshStandardMaterialParameters,
Vector2, Vector3, Object3D Vector2, Vector3
} from 'three'; } from 'three';
import { useTresContext, useSeek, useTexture, useLoop } from '@tresjs/core'; import { useTresContext, useSeek, useTexture, useLoop } from '@tresjs/core';
import { useGLTF } from '@tresjs/cientos' import { useGLTF } from '@tresjs/cientos'
import Env from './env.vue' import Env from './env.vue'
import PostProcessing from './post_processing.vue'
import { IMAGE_URL, PROMOBG, SERVER_URL, } from '../../constants' import { IMAGE_URL, PROMOBG, SERVER_URL, } from '../../constants'
import { usePromoSidebar } from '../../stores/promo_sidebar'; import { usePromoSidebar } from '../../stores/promo_sidebar';
@ -308,6 +309,7 @@ watch(() => sidebar_scene.list, () => {
<template> <template>
<TresGroup name="loaded"> <TresGroup name="loaded">
<Env v-bind="envVars" /> <Env v-bind="envVars" />
<PostProcessing />
<template v-for="item in models"> <template v-for="item in models">
<TresGroup :name="item.name"> <TresGroup :name="item.name">
<TresObject3D v-bind="item.modelFile.clone()" /> <TresObject3D v-bind="item.modelFile.clone()" />

View File

@ -1,46 +0,0 @@
<script setup lang="ts">
import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js';
import { RenderPass } from 'three/addons/postprocessing/RenderPass.js';
import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js';
import { BokehPass } from 'three/addons/postprocessing/BokehPass.js';
import { OutputPass } from 'three/addons/postprocessing/OutputPass.js';
import { useTresContext, useLoop } from '@tresjs/core';
import { watch } from 'vue';
import { Color, Fog } from 'three';
const { renderer, camera, scene } = useTresContext()
const composer = new EffectComposer(renderer.value);
const props = defineProps(['tiltShift'])
const k = { start: 0.5, end: 2.5 }
const makePostProcess = () => {
if (camera.value) {
const renderPass = new RenderPass(scene.value, camera.value);
const bokehPass = new BokehPass(scene.value, camera.value, {
focus: props.tiltShift.focus,
aperture: (props.tiltShift.aperture) * 0.00001,
maxblur: (props.tiltShift.maxblur) * 0.01
});
const outputPass = new OutputPass();
// composer.addPass(renderPass);
// composer.addPass(bokehPass);
// composer.addPass(outputPass);
const c = new Color()
renderer.value.getClearColor(c)
scene.value.fog = new Fog(c, props.tiltShift.focus * k.start, props.tiltShift.focus * k.end)
}
}
makePostProcess()
const { onAfterRender } = useLoop()
onAfterRender(() => {
// composer.render()
})
watch(props.tiltShift, makePostProcess, { deep: true })
</script>
<template></template>

View File

@ -0,0 +1,28 @@
<script setup lang="ts">
import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js';
import { RenderPass } from 'three/addons/postprocessing/RenderPass.js';
import { OutlinePass } from 'three/addons/postprocessing/OutlinePass.js';
import { OutputPass } from 'three/addons/postprocessing/OutputPass.js';
import { useTresContext, useLoop } from '@tresjs/core';
import { Vector2 } from 'three';
const { renderer, camera, scene } = useTresContext()
const composer = new EffectComposer(renderer.value);
const makePostProcess = () => {
if (camera.value) {
const renderPass = new RenderPass(scene.value, camera.value);
const outlinePass = new OutlinePass( new Vector2( window.innerWidth, window.innerHeight ), scene.value, camera.value)
const outputPass = new OutputPass();
composer.passes = [renderPass, outlinePass, outputPass]
}
}
makePostProcess()
const { onAfterRender } = useLoop()
onAfterRender(() => {
composer.render()
})
</script>
<template></template>