mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
fix camera size scaling
This commit is contained in:
Vendored
+380
-11
File diff suppressed because one or more lines are too long
@@ -103,7 +103,7 @@ export class WebGL2GFXDevice extends GFXDevice {
|
||||
const webGLCtxAttribs: WebGLContextAttributes = {
|
||||
alpha: true,
|
||||
// antialias: this._isAntialias,
|
||||
antialias: false,
|
||||
antialias: true,
|
||||
depth: true,
|
||||
stencil: true,
|
||||
premultipliedAlpha: this._isPremultipliedAlpha,
|
||||
|
||||
@@ -12,7 +12,7 @@ export enum ForwardFlowPriority {
|
||||
FORWARD = 0,
|
||||
}
|
||||
|
||||
const _idVec4Array = Float32Array.from([0, 0, 0, 1]);
|
||||
const _idVec4Array = Float32Array.from([1, 1, 1, 0]);
|
||||
|
||||
export class ForwardPipeline extends RenderPipeline {
|
||||
|
||||
|
||||
@@ -46,9 +46,11 @@ export class ForwardStage extends RenderStage {
|
||||
const queue = this._pipeline.queue;
|
||||
|
||||
const camera = view.camera!;
|
||||
|
||||
this._renderArea.width = camera.width;
|
||||
this._renderArea.height = camera.height;
|
||||
const vp = camera.viewport;
|
||||
this._renderArea.x = vp.x * camera.width;
|
||||
this._renderArea.y = vp.y * camera.height;
|
||||
this._renderArea.width = vp.width * camera.width;
|
||||
this._renderArea.height = vp.height * camera.height;
|
||||
colors[0] = camera.clearColor;
|
||||
|
||||
cmdBuff.begin();
|
||||
|
||||
@@ -162,11 +162,11 @@ export class Camera {
|
||||
return this._proj;
|
||||
}
|
||||
|
||||
set viewport (v) {
|
||||
set viewport (v: Rect) {
|
||||
this._viewport = v;
|
||||
}
|
||||
|
||||
get viewport () {
|
||||
get viewport (): Rect {
|
||||
return this._viewport;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Node } from '../../scene-graph/node';
|
||||
import { RenderScene } from './render-scene';
|
||||
import { vec4 } from '../../core/vmath';
|
||||
|
||||
export enum LightType {
|
||||
DIRECTIONAL,
|
||||
|
||||
Reference in New Issue
Block a user