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: add graphic bath mesh #319

Merged
merged 60 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
a1eeb04
feat: add new prefab data load and parser
ZenderJK Sep 22, 2023
9f4ce44
feat: add prefab morph animation
ZenderJK Sep 23, 2023
139b5fe
fix: close sample prefab debug
ZenderJK Sep 23, 2023
54dbe26
feat: add blend shape anim
ZenderJK Sep 23, 2023
4ae2756
feat: add animtor split blendShape and skeleton anim
ZenderJK Sep 25, 2023
e9ea667
fix: fix animator
ZenderJK Sep 25, 2023
3f04a6a
feat: add skeleton setting
ZenderJK Sep 26, 2023
3b5cbec
feat: Add feature of new Bloom Post.
hellmor Sep 26, 2023
8fcd491
feat: add BitMap
ZenderJK Sep 26, 2023
94af644
feat: new bloom
hellmor Sep 26, 2023
e17cf42
fix(parser): remove repeat field 'format'
Codeboy-cn Sep 26, 2023
10950ec
Merge branch 'dev-prefab' of github.com:hellmor/orillusion into dev-p…
hellmor Sep 26, 2023
80cf250
Merge branch 'dev-prefab' of https://github.com/X-OldGentleMan/orillu…
hellmor Sep 26, 2023
5278f9f
fix: res error
hellmor Sep 26, 2023
123e2be
fix: fix skeleton world position
ZenderJK Sep 26, 2023
d20dbe1
Merge branch 'dev-prefab' of https://github.com/X-OldGentleMan/orillu…
ZenderJK Sep 26, 2023
2249167
fix: fix apath components
ZenderJK Sep 26, 2023
d3a7c71
fix: fix value parser to comdata
ZenderJK Sep 27, 2023
4b6d159
fix: open graphic used in normal render
ZenderJK Sep 27, 2023
6932f4d
fix: fix graphic update
ZenderJK Sep 27, 2023
6050f01
fix: fix prefab node name
ZenderJK Sep 27, 2023
7f63bce
feat(CameraController): HoverCameraController add flowTarget
Codeboy-cn Sep 27, 2023
d61894e
feat:Replace old Bloom.
hellmor Sep 27, 2023
9737347
Merge branch 'dev-prefab' of https://github.com/X-OldGentleMan/orillu…
hellmor Sep 27, 2023
49356f2
fix: fix blendShape
ZenderJK Sep 28, 2023
18bd9a5
feat: add new material shader
ZenderJK Oct 2, 2023
40ece5c
feat: add LitSSSShader
ZenderJK Oct 3, 2023
cb1f8cf
feat: add navigation mesh path finder.
hellmor Oct 10, 2023
4edd6ee
feat: adapt Navi3DConst value.
hellmor Oct 10, 2023
210e828
fix: NaN error
hellmor Oct 12, 2023
c5b17d7
fix: exclude zero direction of calc navi mesh
hellmor Oct 13, 2023
ba6bb4e
fix(LitShader): register missing
Codeboy-cn Oct 17, 2023
cab2558
feat: add navi mesh parse action.
hellmor Oct 17, 2023
9d5fda9
Merge branch 'dev-prefab' of https://github.com/X-OldGentleMan/orillu…
hellmor Oct 17, 2023
bd27e90
feat(subShader): add sub shader
ZenderJK Oct 19, 2023
905386b
feat: fix morphTarget sample.
hellmor Oct 20, 2023
2b79996
feat: fix gui util of bloom
hellmor Oct 20, 2023
a520e20
feat(material): add new shader and material pass
ZenderJK Oct 24, 2023
daa1521
Merge branch 'dev-subShader' of https://github.com/X-OldGentleMan/ori…
ZenderJK Oct 24, 2023
230efe2
fix: fix new skin component clone
ZenderJK Oct 24, 2023
bcc3ca0
fix: fix sample renderer error
ZenderJK Oct 25, 2023
869fda3
fix: lost GI pass.
hellmor Oct 25, 2023
40e9259
feat(setting): add loader setting
Codeboy-cn Oct 25, 2023
a829d07
feat(graphic): add graphic mesh
ZenderJK Oct 26, 2023
a71e22d
fix: build failure
Codeboy-cn Oct 26, 2023
ca2c251
feat(graphicMesh): add graphic mesh
ZenderJK Oct 26, 2023
13f108c
feat: fix errors of samples
hellmor Oct 26, 2023
2050025
fix: fix no post resize canvas
ZenderJK Oct 26, 2023
f16bb78
feat: add graphicMesh
ZenderJK Oct 27, 2023
06997f7
fix: fix pointlight shadow
ZenderJK Oct 27, 2023
5d3a93d
fix: remove more class
ZenderJK Oct 28, 2023
9e9586c
chore: remove sample
ZenderJK Oct 28, 2023
4c8c41b
fix: fix import
ZenderJK Oct 28, 2023
8d4cb8a
fix: fix sphere geometry uv
ZenderJK Oct 29, 2023
cdaeca6
fix: CI check failure
Codeboy-cn Oct 30, 2023
3aa3dc9
fix: pick sample
Codeboy-cn Oct 30, 2023
83450b6
chore: remove sample_prefab
Codeboy-cn Oct 30, 2023
76d30f5
fix: GI samples.
hellmor Oct 30, 2023
7cb056b
Merge branch 'dev-subShader' of github.com:X-OldGentleMan/orillusion …
hellmor Oct 30, 2023
88fe65d
feat: fix ch char
hellmor Oct 31, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Orillusion | Samples</title>
<title>Graphic3D | Samples</title>
<style>
html,
body {
Expand Down Expand Up @@ -115,11 +115,11 @@
}
</style>
</head>

<body>
<svg class="toggle" onclick="document.body.classList.add('show')" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
<path d="M17,11H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S17.6,11,17,11z"></path><path d="M21,7H3C2.4,7,2,6.6,2,6s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,7,21,7z"></path><path d="M21,15H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h18c0.6,0,1,0.4,1,1S21.6,15,21,15z"></path><path d="M17,19H3c-0.6,0-1-0.4-1-1s0.4-1,1-1h14c0.6,0,1,0.4,1,1S17.6,19,17,19z"></path>
</svg>
<script src="https://unpkg.com/peerjs@1.5.0/dist/peerjs.min.js"></script>
<script type="module" src="/samples/index.ts"></script>
</body>
</html>
1 change: 1 addition & 0 deletions index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./src/index"
2 changes: 2 additions & 0 deletions packages/debug/GUIHelp.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { GTAOPost } from '../../src/index.js';
import { GUI } from './dat.gui.module.js'

/**
* @internal
*/
class _GUIHelp {

public debug: boolean = false;
public data: any;
public gui: GUI;
Expand Down
3 changes: 3 additions & 0 deletions packages/effect/grass/geometry/GrassGeometry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ export class GrassGeometry extends GeometryBase {
indexCount: indexes.length,
vertexStart: 0,
index: 0,
vertexCount: 0,
firstStart: 0,
topology: 0
});

this.bounds = new BoundingBox(Vector3.ZERO, new Vector3(9999, 9999, 9999));
Expand Down
113 changes: 37 additions & 76 deletions packages/effect/grass/material/GrassMaterial.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BlendMode, Color, GPUAddressMode, Material, RenderShader, RendererType, ShaderLib, Texture, Vector2, Vector3, Vector4 } from "@orillusion/core";
import { BlendMode, Color, GPUAddressMode, Material, RenderShaderPass, PassType, Shader, ShaderLib, Texture, Vector2, Vector3, Vector4 } from "@orillusion/core";
import { GrassShader } from "../shader/GrassShader";
import { GrassVertexAttributeShader } from "../shader/GrassVertexAttributeShader";
import { GrassCastShadowShader } from "../shader/GrassCastShadowShader";
Expand All @@ -7,11 +7,12 @@ export class GrassMaterial extends Material {
constructor() {
super();

let newShader = new Shader();
ShaderLib.register("GrassVertexAttributeShader", GrassVertexAttributeShader);
ShaderLib.register("GrassShader", GrassShader);

let colorPass = new RenderShader(`GrassShader`, `GrassShader`);
this.defaultPass = colorPass;
let colorPass = new RenderShaderPass(`GrassShader`, `GrassShader`);
colorPass.passType = PassType.COLOR;
colorPass.setShaderEntry(`VertMain`, `FragMain`)
colorPass.setDefine("TRANSFORMVERTEX", true);
let shaderState = colorPass.shaderState;
Expand All @@ -21,17 +22,18 @@ export class GrassMaterial extends Material {
shaderState.useLight = true;
shaderState.castShadow = false;
shaderState.blendMode = BlendMode.NONE;
newShader.addRenderPass(colorPass);

ShaderLib.register("GrassCastShadowShader", GrassCastShadowShader);

let shadowPass = new RenderShader(`GrassCastShadowShader`, `GrassCastShadowShader`);
let shadowPass = new RenderShaderPass(`GrassCastShadowShader`, `GrassCastShadowShader`);
shadowPass.passType = PassType.SHADOW
shadowPass.setDefine("USE_ALPHACUT", true);
shadowPass.setDefine("TRANSFORMVERTEX", true);
shadowPass.setShaderEntry(`VertMain`)
shadowPass.shaderState.blendMode = BlendMode.NONE;
shadowPass.shaderState.receiveEnv = false;
this.addPass(RendererType.SHADOW, shadowPass);

newShader.addRenderPass(shadowPass);

colorPass.setUniformColor("baseColor", new Color(0.0, 1.0, 0.0, 1.0));
colorPass.setUniformColor("grassBottomColor", new Color(3 / 255, 16 / 255, 3 / 255));
Expand Down Expand Up @@ -67,159 +69,118 @@ export class GrassMaterial extends Material {
// this.baseMap = Engine3D.res.whiteTexture;
colorPass.doubleSide = true;
shadowPass.doubleSide = true;

this.shader = newShader;
}

public set baseMap(texture: Texture) {
// texture.visibility = GPUShaderStage.VERTEX | GPUShaderStage.FRAGMENT;
let shadowPass = this.getPass(RendererType.SHADOW)[0];

this.defaultPass.setTexture(`baseMap`, texture);
shadowPass.setTexture(`baseMap`, texture);
this.shader.setTexture(`baseMap`, texture);
}

public get baseMap(): Texture {
return this.defaultPass.getTexture(`baseMap`);
return this.shader.getTexture(`baseMap`);
}

public set windMap(texture: Texture) {
// texture.visibility = GPUShaderStage.VERTEX;
texture.addressModeU = GPUAddressMode.repeat;
texture.addressModeV = GPUAddressMode.repeat;
this.defaultPass.setTexture("windMap", texture);
let shadowPass = this.getPass(RendererType.SHADOW)[0];

shadowPass.setTexture("windMap", texture);
this.shader.setTexture("windMap", texture);
}

public set windBound(v: Vector4) {
this.defaultPass.setUniformVector4("windBound", v);
let shadowPass = this.getPass(RendererType.SHADOW)[0];

this.defaultPass.setUniformVector4("windBound", v);
shadowPass.setUniformVector4("windBound", v);
this.shader.setUniformVector4("windBound", v);
}

public get windBound(): Vector4 {
return this.defaultPass.uniforms["windBound"].vector4;
return this.shader.getUniform("windBound").data;
}

public set grassBaseColor(v: Color) {
this.defaultPass.setUniformColor("grassBottomColor", v);
let shadowPass = this.getPass(RendererType.SHADOW)[0];
shadowPass.setUniformColor("grassBottomColor", v);
this.shader.setUniformColor("grassBottomColor", v);
}

public get grassBaseColor(): Color {
return this.defaultPass.uniforms["grassBottomColor"].color;
return this.shader.getUniformColor("grassBottomColor");
}

public set grassTopColor(v: Color) {
this.defaultPass.setUniformColor("grassTopColor", v);
let shadowPass = this.getPass(RendererType.SHADOW)[0];

shadowPass.setUniformColor("grassTopColor", v);
this.shader.setUniformColor("grassTopColor", v);
}

public get grassTopColor(): Color {
return this.defaultPass.uniforms["grassTopColor"].color;
return this.shader.getUniformColor("grassTopColor");
}

public set windDirection(v: Vector2) {
this.defaultPass.setUniformVector2("windDirection", v);
let shadowPass = this.getPass(RendererType.SHADOW)[0];

shadowPass.setUniformVector2("windDirection", v);
this.shader.setUniformVector2("windDirection", v);
}

public get windDirection(): Vector2 {
return this.defaultPass.uniforms["windDirection"].vector2;
return this.shader.getUniform("windDirection").data;
}

public set windPower(v: number) {
this.defaultPass.setUniformFloat("windPower", v);
let shadowPass = this.getPass(RendererType.SHADOW)[0];

shadowPass.setUniformFloat("windPower", v);
this.shader.setUniformFloat("windPower", v);
}

public get windPower(): number {
return this.defaultPass.uniforms["windPower"].data;
return this.shader.getUniform("windPower").data;
}

public set windSpeed(v: number) {
this.defaultPass.setUniformFloat("windSpeed", v);
let shadowPass = this.getPass(RendererType.SHADOW)[0];

shadowPass.setUniformFloat("windSpeed", v);
this.shader.setUniformFloat("windSpeed", v);
}

public get windSpeed(): number {
return this.defaultPass.uniforms["windSpeed"].data;
return this.shader.getUniform("windSpeed").data;
}

public set grassHeight(v: number) {
this.defaultPass.setUniformFloat("grassHeight", v);
let shadowPass = this.getPass(RendererType.SHADOW)[0];

shadowPass.setUniformFloat("grassHeight", v);
this.shader.setUniformFloat("grassHeight", v);
}

public get grassHeight(): number {
return this.defaultPass.uniforms["grassHeight"].data;
return this.shader.getUniform("grassHeight").data;
}

public set curvature(v: number) {
this.defaultPass.setUniformFloat("curvature", v);
let shadowPass = this.getPass(RendererType.SHADOW)[0];

shadowPass.setUniformFloat("curvature", v);
this.shader.setUniformFloat("curvature", v);
}

public get curvature(): number {
return this.defaultPass.uniforms["curvature"].data;
return this.shader.getUniform("curvature").data;
}

public set roughness(v: number) {
this.defaultPass.setUniformFloat("roughness", v);
let shadowPass = this.getPass(RendererType.SHADOW)[0];

shadowPass.setUniformFloat("roughness", v);
this.shader.setUniformFloat("roughness", v);
}

public get roughness(): number {
return this.defaultPass.uniforms["roughness"].data;
return this.shader.getUniform("roughness").data;
}

public set translucent(v: number) {
this.defaultPass.setUniformFloat("translucent", v);
let shadowPass = this.getPass(RendererType.SHADOW)[0];

shadowPass.setUniformFloat("translucent", v);
this.shader.setUniformFloat("translucent", v);
}

public get translucent(): number {
return this.defaultPass.uniforms["translucent"].data;
return this.shader.getUniform("translucent").data;
}

public set soft(v: number) {
this.defaultPass.setUniformFloat("soft", v);
let shadowPass = this.getPass(RendererType.SHADOW)[0];

shadowPass.setUniformFloat("soft", v);
this.shader.setUniformFloat("soft", v);
}

public get soft(): number {
return this.defaultPass.uniforms["soft"].data;
return this.shader.getUniform("soft").data;
}

public set specular(v: number) {
this.defaultPass.setUniformFloat("specular", v);
let shadowPass = this.getPass(RendererType.SHADOW)[0];

shadowPass.setUniformFloat("specular", v);
this.shader.setUniformFloat("specular", v);
}

public get specular(): number {
return this.defaultPass.uniforms["specular"].data;
return this.shader.getUniform("specular").data;
}
}
1 change: 1 addition & 0 deletions packages/effect/grass/shader/GrassCastShadowShader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export let GrassCastShadowShader = /* wgsl */`
var windMap: texture_2d<f32>;

const DEGREES_TO_RADIANS : f32 = 3.1415926 / 180.0 ;
const PI : f32 = 3.1415926 ;

@vertex
fn VertMain( vertex:VertexAttributes ) -> VertexOutput {
Expand Down
1 change: 1 addition & 0 deletions packages/effect/grass/shader/GrassShader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export let GrassShader = /* wgsl */`
var windMap: texture_2d<f32>;

const DEGREES_TO_RADIANS : f32 = 3.1415926 / 180.0 ;
const PI : f32 = 3.1415926 ;

@vertex
fn VertMain( vertex:VertexAttributes ) -> VertexOutput {
Expand Down
4 changes: 2 additions & 2 deletions packages/media-extention/ChromaKeyMaterial.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Engine3D, ShaderLib, Vector4, Color, BlendMode, registerMaterial, Material, RenderShader, Texture } from "@orillusion/core";
import { Engine3D, ShaderLib, Vector4, Color, BlendMode, registerMaterial, Material, RenderShaderPass, Texture } from "@orillusion/core";
import { ChromaKeyShader } from "./ChromaKeyShader";

/**
Expand All @@ -14,7 +14,7 @@ export class ChromaKeyMaterial extends Material {
super();

ShaderLib.register("ChromaKeyShader", ChromaKeyShader);
this.defaultPass = new RenderShader(
this.defaultPass = new RenderShaderPass(
`ChromaKeyShader`,
`ChromaKeyShader`
);
Expand Down
4 changes: 2 additions & 2 deletions packages/media-extention/ImageMaterial.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Engine3D, ShaderLib, Vector4, Color, Texture, Material, RenderShader } from "@orillusion/core";
import { Engine3D, ShaderLib, Vector4, Color, Texture, Material, RenderShaderPass } from "@orillusion/core";
import ImageMaterialShader from "./ImageMaterialShader.wgsl?raw";


Expand All @@ -15,7 +15,7 @@ export class ImageMaterial extends Material {
constructor() {
super();
ShaderLib.register("ImageMaterialShader", ImageMaterialShader);
this.defaultPass = new RenderShader(`ImageMaterialShader`, `ImageMaterialShader`);
this.defaultPass = new RenderShaderPass(`ImageMaterialShader`, `ImageMaterialShader`);
this.defaultPass.setShaderEntry(`VertMain`, `FragMain`)
this.defaultPass.setUniformVector4(`transformUV1`, new Vector4(0, 0, 1, 1));
this.defaultPass.setUniformVector4(`transformUV2`, new Vector4(0, 0, 1, 1));
Expand Down
Loading