MshViewer 2.0 [Version 1.2.1]

Working on a new map? Have a new mod out for swbf2?! Post an announcement of the up-coming release here.

Moderator: Moderators

User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

MshViewer 2.0 [Version 1.2.1]

Post by Anakin »

Hey,

i'm not sure if this is the right section, but it is WIP and i hope it's about 50% done.

So what is it about?
You may already know that i'm working on an own mesh viewer since the functions of the old one is really limited and there are functions i don't like or i miss.

What is the different to the old MeshViewer?
I don't know what language was used for the old one, but i'm using C++ with OpenGL. The benefit of OpenGL is, that it can be used as game engine, so it's also possible to display render flags, such as bump maps or animations.

Wait, we can view all animations on every unit with this viewer??
Actually it is possible to do this. But i will first concentrate on the basics. Display all mesh correctly.

How can i help?
At the moment i'm working on the basics, but i plan to enable addon support. So you can write your own functions for this viewer. For example addon hex editing.

What is done, what need to be done?
I learned about OpenGL and i already can read in tga files and the mesh file. But at the moment it's limited to triangulated mesh with only one model and texture.

I want to test this awesome project!
I hosted the whole project on gitlab: https://git.rwth-aachen.de/carstenf/OpenGL/tree/master
The 3D Viewer was just for testing OpenGL. If you know how to program you can need to import the MeshViewer Project. It's a Visual Studio 2015 Project.
If you just want to test whether the project is running on your system or not, just download the release folder and run the exe.

If the viewer is not running on your system, please let me know the error message and your system information.


Any help or suggestions are always welcome.

EDIT
i wonder whether the OpenGL project works for you, since i worked on a different pc today and it didn't because there was only OpenGL 2.1 :-/

So please check the release thread:
https://git.rwth-aachen.de/carstenf/OpenGL


How to build the latest version by your own from the source:

================UPDATE================
Go and and download the updater from the release thread.
=====================================
Hidden/Spoiler:
go to https://git-scm.com/download and download git for your system. On my test system i'll use Windows 32 bit.
Image
i use the default settings
Image

all right, now get qt at https://www.qt.io/download-open-source/. Skip the Qt Account window and choose these settings
Image

now you make a new emty qt project. Go to File>new. Choose other projects>empty qmake-project
Image
and save it somewhere on your harddrive. I'll choose C:/Users/Anakin/workspace/
name your project QtMeshViewer
Image
and klick next until you are done.

open QtMeshViewer.pro and add this:
[code]
QT += core gui opengl
CONFIG += c++11
LIBS += -lopengl32
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = QtMeshViewer
TEMPLATE = app
[/code]

================UPDATE================
Place the .bat file at
C:\Users\Anakin\workspace (remember your path here)
run the exe with the parameter src the first time.
Skip everything between the "===" lines
=====================================

now open a command promt (cmd) and enter the following lines

cd C:\Users\Anakin\workspace (remember your path here)
git init
git remote add origin -f https://git.rwth-aachen.de/carstenf/OpenGL.git
git config core.sparsecheckout true
echo QtMeshViewer/*> .git/info/sparse-checkout
git pull origin master

Image

=====================================

now you go back to Qt Creator, right klick on the project>add existing file (you need to do it multiple times) and choose:
../QtMeshViewer/main.cpp
../QtMeshViewer/Source/* (you can choose all of them at once)
../QtMeshViewer/Header/*
../QtMeshViewer/Form Files/*
../QtMeshViewer/Resources/Resources.qrc

Now you need to go back to the .pro file and change this
[code]
FORMS += \
Form Files/FileInfoWindow.ui \
Form Files/MainWindow.ui \
Form Files/SettingsWindow.ui
[/code]

to this

[code]
FORMS += \
"Form Files/FileInfoWindow.ui" \
"Form Files/MainWindow.ui" \
"Form Files/SettingsWindow.ui"
[/code]

finaly press the green run button in the lower left corner.

================UPDATE================
to get the latest build just run the updater. No need to pass
src to it again. You can just double klick it.
=====================================
If you want to get the latest build, go to your console, browse your location and repeat the last command
git pull origin master
=====================================

If i add any new files you need to add them to the project like you did above
Last edited by Anakin on Sun Feb 05, 2017 9:57 am, edited 11 times in total.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: MesViewer 2.0

Post by Marth8880 »

@Anakin: The repo seems to be private (or just gone).
Hidden/Spoiler:
Image

Image
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: MesViewer 2.0

Post by Anakin »

You haven't checked the new link ;)

I'm no longer on github. I moved to gitlab
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: MesViewer 2.0

Post by Marth8880 »

Lolz whoops, my bad.

Alright, so I'm trying it out and it seems to run fine, but is there a way to open a msh file yet? I've tried dragging and dropping one onto it (which I saw is on your to-do list) but it doesn't seem to do anything, so I assume not.
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: MshViewer 2.0 [Version 0.0.5]

Post by Anakin »

Ähm, no the user interaction isn't done yet. I'm still working on the import and display function. Need to figure out how to import cluster and their textures. Then I need to go trough the structure and apply the translation matrix of all parents as well.
And then I can think of the user interaction. But if you name your mesh file multipleModTex and replace the one in the release folder you can try to display other mesh.

==EDIT==

you want it? you get it :D

I just updated the release folder. Now you can drag n drop files. I tested a few swbf2 assets but non worked for me. There seams to be lot of untriangulated things. And for now i only support triangulated mesh.


==UPDATE==

new features coming with the next release:
- cluster support (textures are mixed for some reason),
- nulls, bones, shadow mesh and hidden models are no longer displayed,
- reset view when loading a new mesh,
- reset view when pressing space
- faster code (frame update is about 19,6% faster, loading mesh is about 15,1% faster, overall from beginning to the first draw about 8,6% faster )

==NEW VERSION==/carstenf/OpenGL/tree/master

Features:
- reset view before loading new mesh
- reset view when pressing space
- clustered msh can be displayed
- shadow mesh, nulls, bones, hidden things are no longer displayed
- now mulitpolygons can be displayed
- fasten and improved code
Bugs:
- cluster mixed up textures,
- at most mesh only every 2nd triangle is displayed,
- triangulation is not very good (DarthDUCK's Proton charge)

Feel free to test it :D


== BETA RELEASE ==

Download

All right, here you go. It should be stable so far. Just ignore the first error message that says something about missing msh file.
Simple drag and drop a file.
Navigation:
left mouse > rotation
right mouse > move
scroll > zoom
+/- > fasten the movement
space > reset view

Please give feedback about missing features or bugs
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: MshViewer 2.0 [Version 0.0.5]

Post by Marth8880 »

It's definitely improving! Great work so far. :thumbs:

Thoughts for now:
- Camera pivot point should be based on the center of the mesh's bounding box. Currently, it seems to be based on the mesh's center of geometry.
- When the camera is panned around, its pivot point should move with it.
- Application begins to lag when higher-poly meshes (>2,500 triangles) are loaded.
- Models need lighting haha
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: MshViewer 2.0 [Version 0.0.5]

Post by Anakin »

Thank you marth :D

You are right i'm using the scene center. But i just looked in the documentation about the bbox and i think, that's easy.
About the lag when loading higher polys, i just changed the texture load function to only give pointer. But i noticed there is data garbage left when closing the software. It's not from my latest changes for the texture loading. So i need to figure out where the garbage is created and where to free it. Then i'll change the object loading itself to use pointer as often as possible too. That way i never need to copy data.

Can you explain the lags a bit? Does it crash, or is it slow? And is it only while loading or after loading, too??
SkinnyODST
Lieutenant Colonel
Lieutenant Colonel
Posts: 545
Joined: Mon Jul 04, 2016 10:56 pm
Location: My other account
Contact:

Re: MshViewer 2.0 [Version 0.0.5]

Post by SkinnyODST »

Doesn`t work. It says "MSVCP140.dll" is missing from my computer.
AQT
Gametoast Staff
Gametoast Staff
Posts: 4910
Joined: Sat Nov 03, 2007 4:55 pm
Location: SoCal, USA

Re: MshViewer 2.0 [Version 0.0.5]

Post by AQT »

User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: MshViewer 2.0 [Version 0.0.6]

Post by Anakin »

Is there someone else, who needs the VS runtime enviroment?? Then i'll include it in the final version.

For now, here is a new release version. Give it a try! it should be much faster then the old version. Opening multiple files should not hurt the performance and even cloth is displayed. Not completely but it is displayed. Furthermore i added some features requested by Marth. For example everything is displayed in the FOV when opening.
Full changelog:

Code: Select all

Features:
- performance improvement,
- code improvement,
- move the model to the center,
- scale everything to 1,
- do not open a default file for release build
Bugs:
- cloth is not displayed correctly,
- turning in the wrong x direction when model is turned 180° in y direction,
- consular class corvette is not displayed,
- rep_weap_LJ-50 is not displayed correctly
For the next version(s) i'm gonna:
- rework my data to improve the loading time and needed memory,
- fix the x rotate direction when turning the model 180° in y direction,
- fixing the cloth problem
- adding some buttons to display some information
- adding light,
- bump/normal/specular map support,

I need to know what kind of information is interesting for you. (texture names?, triangle count?,...) Please let me know what you wanna know.
Do you need a button to open a file? Or do you only need the drag/drop function?


Download
User avatar
Oceans14
Command Sergeant Major
Command Sergeant Major
Posts: 296
Joined: Mon Apr 27, 2015 7:09 pm
Projects :: Athenova Campaign
Games I'm Playing :: SWBF2
Location: Planet 4546b

Re: MshViewer 2.0 [Version 0.0.6]

Post by Oceans14 »

It says my GPU doesn't support Open GL 4.5. (nVidia quadro nvs 4200m, win7 pro x64). I'll look around for driver updates, although I just installed one a few weeks ago.

For features, I use texture names and tri count a lot. Drag n drop is fine for input. I think it would be helpful to have the ability to toggle on/off hidden components like nulls, bones, shadowvolume, collision, etc. Maybe those could be flat shaded in different colors or something? For example, most of the nab2 buildings have collision that extends well above the visible mesh, and it would be cool to be able to see this in the viewer. And being able to quickly get the location of nulls for attaching effects would be extremely useful.

Another feature that may or may not be useful is a grid centered at 0,0,0 like in xsi. Idk how useful it would really be, but I just had the thought and figured I'd share it.
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: MshViewer 2.0 [Version 0.0.6]

Post by Anakin »

Try to run it from console with the parameters 3 5

so you type

Code: Select all

MshViewer.exe 3 5
User avatar
Oceans14
Command Sergeant Major
Command Sergeant Major
Posts: 296
Joined: Mon Apr 27, 2015 7:09 pm
Projects :: Athenova Campaign
Games I'm Playing :: SWBF2
Location: Planet 4546b

Re: MshViewer 2.0 [Version 0.0.6]

Post by Oceans14 »

Anakin wrote:Try to run it from console with the parameters 3 5

so you type

Code: Select all

MshViewer.exe 3 5
Actually I forgot my laptop has dual graphics, and apparently the low performance intel chip was trying to run it. Switched over to the nVidia and it works like a charm with 4.5
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: MshViewer 2.0 [Version 0.0.6]

Post by Anakin »

Great :D

And i have good news. I'm gonna switch to Qt library and i hope i get this working with OpenGL ES 2.0. That way it should theoretically work even on your mobile phone :D


Just one question. I'm looking for an program icon. I thought of an Imperial Commando Helmet. Do you prefer the red or blue visor??
displayed in my Mesh Viewer :D (but the red visor is rendered in XSI and photoshoped)
Hidden/Spoiler:
Image
Troha
Private Recruit
Posts: 18
Joined: Sat Aug 23, 2014 8:09 pm

Re: MshViewer 2.0 [Version 0.0.6]

Post by Troha »

Blue Visor
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: MshViewer 2.0 [Version 0.1.0]

Post by Anakin »

Hi,

it's been a while since the last update. The reason for that is, i changed my library from glew to Qt. It's more powerful and allows much more window adjustments.
So this new release does not feel much new to you since most new things are behind the scene in the source code.

Code: Select all

Features:
-changed library,
-new interaction,
-new software icon,
-rotation bug fixed,
-cloth bug fixed,
Bugs:
-rle compressed tga not working.
-old assets are not displayed correctly,
Mainly there is one big problem. Some mesh are not displayed correctly. I don't know why. When i load them into XSI and reexport through ZETools everything is displayed correctly. I'm gonna search that bug and hopefully will fix it in the next release. The other problem is that Qt does not support RLE compressed tga files. So i'd like to ask you to use this new version and check if there are many assets with rle compressed tga files. You can fix it by simply open the tga and save without rle.
If there are many rle conflicts i'll see if i can add the rle support again.

(tipp: to rotate in Z direction hold the mouse and draw circles ;) )

Source
Download
User avatar
Luke
Private First Class
Posts: 75
Joined: Sat Feb 18, 2012 5:36 am
Projects :: Caron Prime - Liberation Action
Games I'm Playing :: SWBF2 SWRC
Location: Germany

Re: MshViewer 2.0 [Version 0.1.0]

Post by Luke »

I'm not sure, but I think Battlefront also doesn't support RLE compressed .tga files, because if I you compress them you'll get an munge error.
If that's right, you wouldn't need to add the rle support.
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: MshViewer 2.0 [Version 1.0.1]

Post by Anakin »

There were textures not working but i noticed that they were not compressed. I simply added my old texture load function if QImage cannot read it my old load will try :D

So and here you go the first full release version:
Features:
- status messages while import,
- fixed triangulation,
- rle and 24 bit image support (normally qt should support 24 bit, too),
- rotation can be limit to the directions,
- added fileinfo,
- performance,
Bugs:
- nothing known

@Marth no there is no light yet

Release thread

==UPDATE==

So since there won't be a new release so fast, i continue here in my WIP thread.

@Marth you are a nettler (i mean this in a friendly way :D) and here you go:
Hidden/Spoiler:
Image
Don't ask me why the wireframe does not work 100%. You can see the problem when you look at a cube:
Hidden/Spoiler:
Image
If the paint function needs the vertice in a different storage i cannot promise that i'll keep this feature. What do you think about the Color? would you prefer solid black or the way it is (from the texture)

So what's new?
- new icons,
- screenshot function with transparent background
- transparent materials are supported
- wireframe paint option (not working very good - see the cube example)
- basic information printed to the scene
- new info window, that always stay on top, can be resized and has scroll area

==EDIT==

fixed wireframe bug


==TEASER==

just hardcoded atm. Need to be user controlled and some more specular (diffuse only atm)
Hidden/Spoiler:
Image
good news @Marth. I think you'll get painted light :D But only after i made a settings window. Btw, what kind of light do you want?? Spot, candle, strait,..??
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: MshViewer 2.0 [Version 1.0.1]

Post by Marth8880 »

Awesome! Great work so far! :thumbs:
Anakin wrote:Btw, what kind of light do you want?? Spot, candle, strait,..??
Just a single directional light.
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: MshViewer 2.0 [Version 1.0.1]

Post by Anakin »

You'll be able to change between point and directional, once i added a settings window.

For now take this:
Hidden/Spoiler:
Image
What's new:
- the light now supports ambient and specular,
- gui changes (button hover, checked),
- zoom speed can be adjust,
- a lot of other things, but i'm too lazy to list them all now.


Is there someone who wants to test a few things that i've implemented, but haven't test now?? You'd need to make some test mesh files and test if the tool reads the material properties correctly.
Post Reply