• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

View in 3D

Status
Not open for further replies.
Level 29
Joined
Jul 29, 2007
Messages
5,174
  • Added specular and normal maps.
  • Now using specular data from the models.
  • Added render modes.
    They will be replaced with check buttons that enable/disable specific features.
  • Emissive maps will be applied after the render modes will change.
  • Optimized animations.
  • The light shape can now be seen above the model.
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
  • Second emissive layer is applied.
  • Emissive-based team color is applied.
  • Specularity is handled (more) correctly using values from the material.
  • Added WIP transparency that probably looks nothing like in-game.
  • Optimized CPU usage by sending far less repetitive data to the graphics card. This change has been added to the WC3 viewer too.

Other changes are not visual, but rather help in making it easier to add support for more types of material layers, with a couple of speed optimizations.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Level 29
Joined
Jul 29, 2007
Messages
5,174
I am in the middle of merging the two viewers.
While this means the code will eventually be better, there are issues regarding the style (borders, background, ground texture).
The issue is that the style can only be determined after the model is loaded and the format is checked.

Here are a few options:
  1. Ditch the whole Nightelf/Terran themes and just put something else (what?).
  2. Set the style with another parameter in the url, which will be set automatically by the Hive for any model opened through it (e.g. style=ne / style=terran).
  3. Set the style properly after the model is loaded, but then the page will look bad until the model is indeed loaded.
  4. Check the file format according to the file extension (.mdx / .m3) for p/mpq paths, and just use .mdx for q=ID, since there is still no way to see the models from the SC2 section.
    This is unlike the current check which checks the magic identifier at the beginning of the actual file data (MDLX / MD34).

Any thoughts about it? (or other options?)

In addition, implemented the collision objects to M3 files, so they can be seen with the collision objects button.

Here are test links:
http://www.hiveworkshop.com/model_viewer/v2/?mpq=Units/Creeps/AzureDragon/AzureDragon.mdx
http://www.hiveworkshop.com/model_viewer/v2/?mpq=Assets/buildings/terran/barracks/barracks.m3
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
Used option 4, since it allows the browser to cache the results better, and replaced the public viewer with the new one.

I think I'll remove the animation speed options since they are useless.

I have always wanted to make the viewer inline to sort of show up like this.

I am not sure how well browsers handle many <canvas>es with WebGL contexts, I'll make a test page and see.
 
Level 29
Joined
Jul 29, 2007
Messages
5,174
It appears like 16 is the common limit of WebGL contexts on PC browsers.

This test shows that performance-wise it works fine (at least on my PC), but this is not scalable.

Something more scalable will be to load multiple models in one viewer. If you'll design a way to do that through the site, I'll add support for it in my code.


Err...did you mean just being inside a box or a gallery?
If the former, make the HTML for it, and decide how it would load (when the page loads? when selected? an option in the user CP? other?).
Remember that the UI has nothing to do with the viewer itself, you can give input to the API in any way you like.

I did say from the beginning (what is it now, two years ago?) that I imagined it being at the same spot as the screenshot, with some button to switch between the two.
 
Last edited:
Level 29
Joined
Jul 29, 2007
Messages
5,174
  • Added badly looking world visibility modes:
    None, sky, sky + ground, sky + water.
  • Changed the way that the camera works.
    Moving around with the right mouse button works again.
  • Default zoom is deduced from the model extents (though they are far from accurate for most models).
  • Put the whole code on github if it interests anyone.
 
Level 35
Joined
Oct 9, 2006
Messages
6,394
The View in 3D mode doesn't appear to be working on my Mac, anyway. I'm using Firefox and I tried it with Safari. I don't know what the problem could be but a fix would be appreciated.

Running any form of script blocker? Not having updated your programs? Any anti virus/spamware/cross-script plugins? Also tested it with more than one model?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
Btw: Anyone knows if it works with Opera?
◾Opera 12.00 or above (enable webGL by entering Enable WebGL in opera:config by setting the value to 1, and Enable Hardware Acceleration similarly, then restart the browser)
It is off by default (unlike IE) I think, although that will probably change in newer versions now that it is standard. Also it may need a reasonably modern computer that supports hardware accelerated browsing.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
IE11 seems to have broken chat a bit. Hard to log into the chatrooms (hangs on the chat prepage when you press the join button). Some times it does join but chat is broken (no one seems to hear you and you never seem to join it, with any messages you type coming from your id number with no avatar.
 
Status
Not open for further replies.
Top