Jump to content
  • entries
    945
  • comments
    5,899
  • views
    930,068

More interface stuff


Josh

3,060 views

 Share

I implemented resizable viewports this morning. This is so much more fun than fiddling around with compiler settings.

 

You can grab the bars between viewports, or the very center space, and drag it around to resize the four viewports. I usually prefer a smaller perspective view, and like to devote most of my space to the 2D views when doing serious editing:

blogentry-1-0-64691500-1312918508_thumb.jpg

 

You can also drag the views around to make a single big viewport, or just have two viewports visible:

blogentry-1-0-69782500-1312918522_thumb.jpg

 

In 3D World Studio, when you resize the window the program instantly redraws, even as you are still moving the window. This is nice looking but it can get slow when you have a large map loaded, and it makes the program feel slow. The problem is even worse with a deferred renderer, because you are constantly creating and deleting those big gbuffers. I don't like hearing the graphics card fan kick up just because I decided to resize a window.

 

I'm getting better results by waiting for the user to let go of the mouse before redrawing viewports, but for window and viewport resizing. This has the effect of displaying "bad"/undefined screen regions while the user is resizing things, but it makes the program very fast and responsive. I used to consider those artifacts to be a sort of amateurish trait, but I think this actually works better. The program feels very fast and light, so I think this is actually a pretty good tradeoff. As soon as you let go of the mouse button, the viewports redraw at their new size.

blogentry-1-0-90640500-1312918513_thumb.jpg

 

--EDIT--

And now we have grids. Starting to look familiar, but new:

blogentry-1-0-76895400-1312934087_thumb.jpg

 Share

11 Comments


Recommended Comments

Yeah, artifacts for a reason is by far a better solution, than to try to fake some visual perfectness with horrible performance and technology behind it.

Link to comment

Another common technique is to overlay an XOR drawing and only resize the stuff when the mouse is let go, but that doesn't work for window resizing, and is Windows-specific. It's not a big thing, but I thought some of the programmers might be interested in what I found.

Link to comment

Well, you could just draw a crosshair showing the possible new window layout. If it's not applied, it never happened, but only a crosshair was shown.

Link to comment

Well, you could just draw a crosshair showing the possible new window layout. If it's not applied, it never happened, but only a crosshair was shown.

 

This was exactly what I was thinking for the solution.

Link to comment

That's what I meant by "XOR drawing". GDI has some functions to draw a negative brush, which is what you are probably thinking of.

Link to comment

Very nice. The resizable view ports kind of remind me of how the new version blender does it. I wonder how blender redraws so well as you resize? I have had pretty heavy scenes and was not to hard on the card.

Link to comment

Very nice. The resizable view ports kind of remind me of how the new version blender does it. I wonder how blender redraws so well as you resize? I have had pretty heavy scenes and was not to hard on the card.

 

The code is open source to find out how. :D

Link to comment

Probably because Blender isn't rendering a lot of post effects and lighting each frame.

 

It's not any slower than the redrawing in the current editor, but given the choice I'd like to keep the program feeling light and as responsive as possible. There's a subtle difference you feel when a program starts fast, closes fast, and resizes fast. Not sure why it makes a difference, but it feels better.

Link to comment

I presume the colour buffer for each window is available and a simple 2D DrawImage stretched to fill the new size while you reposition is possible.

 

Personally, so long as I can position things fast an easy it's all good.

Link to comment

I've considered that, but the 2D views are actually rendered straight to the back buffer. Also, not all supported hardware the engine runs on even support render-to-texture! :o Now you get an idea of the constraints I deal with. :D

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...