These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
Previous page12
 

HTML5, .cube files, the eve online shipviewer, and your website. UPDATED

First post
Author
Gogela
Epic Ganking Time
CODE.
#21 - 2013-01-09 20:18:13 UTC  |  Edited by: Gogela
Liu Ellens wrote:
Ok, finally found some time for hacking and got it. (Pics or it didn't happen *)

Disclaimer: I made a hack and this is just for research use; Proper cleanup would be required and I'd prefer a dedicated solution to be done (i.e., write a dedicated ship viewer instead of waiting for the unmodified source - like I did with upro & a map viewer ;)

Anyway, simply removing the nebulae did not entirely work, the corresponding skybox would still be rendered - and without a texture, it came out black.
In the CCPShipViewer.Render() method some tweaks were needed. This method is right at the top, so not much to search.
original (Chrome beautified) wrote:

...

camera.Update(f), scene.Update(f), device.SetStandardStates(device.RM_OPAQUE), device.gl.clearColor(0, 0, 0, 0), device.gl.clearDepth(1), device.gl.viewport(0, 0, device.gl.viewportWidth, device.gl.viewportHeight), device.gl.clear(device.gl.COLOR_BUFFER_BIT | device.gl.DEPTH_BUFFER_BIT), ship && ship.boosterGain < boosterGain && (ship.boosterGain += boosterGain / 80);
if (quality == 3) {
var g = camera.GetView(), h = mat4.inverse(g, mat4.create()), i = mat4.multiplyVec4(h, [1, 1, 2, 0], quat4.create());
vec3.set(i, scene.sunDirection)
}
device.SetProjection(camera.GetProjection()), device.SetView(camera.GetView()), scene.Render(), ref.postprocessEnabled && postprocess.Render()
...


a little bit reordered and modified:

hack wrote:

camera.Update(f), scene.Update(f), device.SetStandardStates(device.RM_TRANSPARENT);

var backAlpha = 0.4;
device.gl.clearColor(0, 0, 0, backAlpha);
device.gl.clearDepth(1);
device.gl.viewport(0, 0, device.gl.viewportWidth, device.gl.viewportHeight);
device.gl.clear(device.gl.COLOR_BUFFER_BIT | device.gl.DEPTH_BUFFER_BIT);
ship && ship.boosterGain < boosterGain && (ship.boosterGain += boosterGain / 80);
if (quality == 3) {
var g = camera.GetView(), h = mat4.inverse(g, mat4.create()), i = mat4.multiplyVec4(h, [1, 1, 2, 0], quat4.create());
vec3.set(i, scene.sunDirection)
}
device.SetProjection(camera.GetProjection()), device.SetView(camera.GetView());
scene.Render();
//ref.postprocessEnabled && postprocess.Render()


In essence:
* the postprocess was removed - looking at the corresponding code it is what I believe to be the sky box.
* the StandardState is set to RM_TRANSPARENT instead of RM_OPAQUE -- mainly to enable BLEND.

The backAlpha is a number 0.0 .. 1.0 specifying the alpha value with 0.0 being fully transparent. The screenshot shows the 0.4 value.

What you will then notice (also visible in the screenshot) is the next problem: Alpha values of textures, as seen with the blinking lights, which appear to be blocky. I didn't want to look into that now, because this topic took me very long to handle in upro ;) Extra time could be spent into looking for that cause, but I'd rather refer to my disclaimer above.

*) I didn't investigate why the whole scene display was moved down, probably a layout issue from my offline version

Maybe we could replace the lights with uncompressed animated transparent gifs? I am going to try to catch up to you and then will look into it... the lights are just pngs w/ render effects I think.

Got it. Man we are in business! This is going to make a huge difference to the look of community sites. The lights thing is an easy fix I think (You should see the blocks on the cynabal's nose!)... working on it now.

Signatures should be used responsibly...

Gogela
Epic Ganking Time
CODE.
#22 - 2013-01-09 23:06:44 UTC  |  Edited by: Gogela
Gogela wrote:

Maybe we could replace the lights with uncompressed animated transparent gifs? I am going to try to catch up to you and then will look into it... the lights are just pngs w/ render effects I think.

Got it. Man we are in business! This is going to make a huge difference to the look of community sites. The lights thing is an easy fix I think (You should see the blocks on the cynabal's nose!)... working on it now.

I was wrong. The blocky parts in the lights are defined in each ships XML data:

http://web.ccpgamescdn.com/shipviewer/assets/dx9/model/ship/angel/battlecruiser/angbc1/angbc1_t1.red

http://web.ccpgamescdn.com/shipviewer/assets/graphics/effect/managed/space/fixedfunctionemulation/ffe30.fx

Also: Don't forget to change your "fallback" image. Looks like hell in browsers that can't handle webGL.

var fallbackImage = document.createElement("img");
fallbackImage.id = "fallbackImage", fallbackImage.alt = ref.selectedShipFact.name, fallbackImage.src = ref.assetsPath + "fallback/" + shipName + ".jpg", fallbackImage.style.width = ref.width + "px", fallbackImage.style.height = ref.height + "px", ref.onFallbackImageLoaded(fallbackImage)

Signatures should be used responsibly...

xHjfx
The Legion of Spoon
Curatores Veritatis Alliance
#23 - 2013-01-09 23:39:47 UTC
NickyYo wrote:
Gogela wrote:
Is there any way to remove the nebulae and background from the ship viewer so that you have the ship flying over a transparency? Anyone know?

Trying to get it done in here:
http://web.ccpgamescdn.com/shipviewer/ccp.shipviewer-0.989.min.js


The javascript isn't even formatted!
It will take years to figure that out!

Quit NOW! unless CCP will sahre the uncompressed version.


http://pastebin.com/MM1HCvDf
Gogela
Epic Ganking Time
CODE.
#24 - 2013-01-24 00:09:39 UTC
OK I've got most of this worked out. Here's a junky garbage bloated version just to see where I'm kind of going with this. I know there's problems from a code clean-up standpoint, but hay, it LOOKS pretty good, right?

Here's a demo

I know there's a lot of problems in the code. I just can't be bothered to fix them atm. This is just a demo of what's possible. Use your imagination for your own application.

Signatures should be used responsibly...

Baeryn
Sol Enterprises
#25 - 2013-03-03 06:08:05 UTC
Great work, guys. I'm now beginning work on integrating this into my embeddable shipviewer.
Roc Wieler
Brutor Tribe
Minmatar Republic
#26 - 2013-04-02 20:05:59 UTC
Baeryn wrote:
Great work, guys. I'm now beginning work on integrating this into my embeddable shipviewer.


I can has Rifter?

Never start a fight you can win.

Gogela
Epic Ganking Time
CODE.
#27 - 2013-04-02 20:14:28 UTC
Roc Wieler wrote:
Baeryn wrote:
Great work, guys. I'm now beginning work on integrating this into my embeddable shipviewer.


I can has Rifter?

That's not up to us. CCP makes the models (cube files etc...) and I'm scared to try and take one of those apart. That's something T'Amber would try probably, because he has the fancy software to do it. I don't have the 3d modeling software. I'm only a marginal graphics guy. I would need a lot of time on my hands just to understand the problem... and I'm not sure I could overcome it. I'm also not sure it's in CCPs marketing interest to let people see ALL the models like that... given the idea is you log into eve to see them.

Signatures should be used responsibly...

Tonto Auri
Vhero' Multipurpose Corp
#28 - 2013-04-02 20:19:08 UTC
Venture image seems distorted.

Two most common elements in the universe are hydrogen and stupidity. -- Harlan Ellison

Il Feytid
State War Academy
Caldari State
#29 - 2013-04-07 00:43:11 UTC
So has anyone come up with a solution for using a ship viewer with a white background?
Gogela
Epic Ganking Time
CODE.
#30 - 2013-04-07 02:10:23 UTC
Marlona Sky wrote:
So has anyone come up with a solution for using a ship viewer with a white background?

You can mess with the alpha levels for most of the ship, but I don't know what to do about the engine trails or lights. You could either try str8 up inverting the colors (would look weird) or you could edit the .CUBE files. What?

Signatures should be used responsibly...

Tripsi Chord
Deep Core Mining Inc.
Caldari State
#31 - 2013-04-17 19:54:37 UTC
Marlona Sky wrote:
So has anyone come up with a solution for using a ship viewer with a white background?


Like That http://dev.pulsar-inc.fr/spaceships.html ?
Gogela
Epic Ganking Time
CODE.
#32 - 2013-04-18 15:31:12 UTC
Tripsi Chord wrote:
Marlona Sky wrote:
So has anyone come up with a solution for using a ship viewer with a white background?


Like That http://dev.pulsar-inc.fr/spaceships.html ?


No. They didn't solve the problem. Pull up the Cynabal and you'll see what I mean. You can adjust some of the alpha levels in the code, but you actually have to edit the cube files for fix the textures, etc. for the lights and some effects.

Signatures should be used responsibly...

Previous page12