State change bug - renderer node not updating viewport
Reported by lindsay.kay (at xeolabs) | October 30th, 2010 @ 11:31 AM | in V0.7.9
From Rehno:
In my game the canvas element is setup up with css to automatically resize with the screen. However, scenejs has some slightly strange behaviour. If my scene starts with a regular "renderer" node then the webgl viewport doesn't appear to change with the canvas size.
E.g. I have:
sceneNode =
type: "scene"
id: "gameScene"
canvasId: "gameCanvas"
loggingElementId: "scenejsLog"
nodes: [
type: "renderer"
clear:
depth: true
color: true
stencil: false
clearColor: { r: 0.7, g: 0.7, b: 0.7 }
nodes: [ ... ]
]
However, as soon as I add a "geometry" node with at least one
triangle
to the scene graph right above the "renderer" node it all works
out
fine.
E.g.
sceneNode =
type: "scene"
id: "gameScene"
canvasId: "gameCanvas"
loggingElementId: "scenejsLog"
nodes: [
type: "geometry"
resource: "tmp"
primitive: "triangles"
positions: [0.0, 0.0, 0.0]
indices: [0, 1, 2]
,
type: "renderer"
clear:
depth: true
color: true
stencil: false
clearColor: { r: 0.7, g: 0.7, b: 0.7 }
nodes: [ ... ]
]
So I suspect some render state change is causing scenejs to
update the
viewport properly in the second case.
I've been keeping track of the issue in my game here: http://github.com/rehno-lindeque/Gates-of-Olympus/issues#issue/9
No comments found
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
SceneJS provides easy access to WebGL through a simple and declarative JavaScript API. The SceneJS API is functional, which enables its scene definitions to be really compact and expressive, while hooking into other JavaScript code just that little bit more smoothly.