Author Topic: WebGL POF preview  (Read 3756 times)

0 Members and 1 Guest are viewing this topic.

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
With WebGL becoming available to a lot of people I was wanting to make some sort of project for it, and I think this might be it.

If I were to make server side PHP scripts that loaded a POF on the server (let us assume that they are just laying around in a folder somewhere) and returned a WebGL friendly version of the LOD0 geometry, and a client side set of scripts that would setup a WebGL canvas, download the previously mentioned geometry, and then draw it in an interactive manner, would the administration of Hard Light Productions be interested in integrating it into their site? I think this could be most useful in the wiki and there might be a way to get it to work such that <long term goal> if someone attaches or links to a properly formatted zip file containing a model and (optionally) textures then rather than just showing a link to the zip file it would show a preview window containing the model that a user could rotate/zoom/ect with all the appropriate effects (assuming they can be done in WebGL), it would probably need to be some new sort of forum tag (like lvlshot).

I will not promise that I will get this done, but if I do would HLP be interested in using it?
Are there any restrictions/requirements that HLP would have for this to be used, assuming it gets done?
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Black Wolf

  • Twisted Infinities
  • 212
  • Hey! You! Get off-a my cloud!
    • Visit the TI homepage!
This would be awesome for the wiki. :yes:
TWISTED INFINITIES · SECTORGAME· FRONTLINES
Rarely Updated P3D.
Burn the heretic who killed F2S! Burn him, burn him!!- GalEmp

 

Offline The E

  • He's Ebeneezer Goode
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
It would also require quite a bit of storage.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
For the wiki, a compressed and optimized version of wanted pofs' geometry could be stored, I think this would have a reasonable storage footprint, the down side is as the viewer was upgraded and new vertex formats were needed every model would have to be re-uploaded, but that is more or less a finite hassle.

As for the forum embedded viewer it would have a storage/performance tradeoff, technically it would not require any more permanent storage than is used currently. the server side script could download the pof/zip to a temporary folder then send off the geometry and then delete the temporary file, this would however be a bandwidth sink, however if it was done on the fly and it cached it's results (and the cache was cleaned periodically (and lets not forget browser caching) ) I think it would have an acceptable resource usage.

also keep in mind there are javascript implementations of many compression algorithms, this could help on both storage, processing, and transmission of geometry.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
HLP would not have a problem with me using jQuery, right?
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Luis Dias

  • 211
How much of bandwith would a Sathanas with 100k polys and three 16Megapixel textures take on bandwith?

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
ballpark guess, 2 megabytes uncompressed. textures should be obvious.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Luis Dias

  • 211
Yeah, I was looking more for a qualitative assessment, rather than quantitative. A jpeg file of a 16MPixel (which translates to 48MB of uncompressed data) will be at least 5MB each. 15MB + 2MB (more or less what I'd guess too), isn't that too much for a wiki page?

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
it could use lower res textures, and it would only be loaded on demand.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
This seems like a really fantastic idea! Though, as a modeller and artist, I would be antsy about people being able to grab the POF before it's finished. (I'm envisioning a way to use it to give more in-depth model previews than screenshots occasionally.)
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
it would be quite difficult (though not impossible) to reconstruct a POF from what the previewer would transmit. if someone wanted to do it they would be able to, but it would be quite an arduous task to convert JSON vertex buffers into some sort of standardized model format.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Luis Dias

  • 211
So how much trouble and work do you think this thing is?

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
well, I already have a client side script that draws an object loaded from a json source and lets you rotate/zoom it, and I am just getting to parsing the BSP tree to get the model geometry, so for basic functionality, another 18 hours of work.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
ok, after working on this for a while, it seems that PHP does not have good enough performance characteristics when dealing with binary data to be able to do this effectively, if I am going to continue I would have to wrap a c/c++ POF handling class that can make vertex and index buffers and wrap a PHP interface around it. I've never done that before, so I'm not sure if I would be able to.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together