Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

State change bug - renderer node not updating viewport

#189

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

Reported by lindsay.kay (at xeolabs) · October 30th, 2010 @ 11:31 AM

State: open
Milestone: V0.7.9

Activity

No comments yet.

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.