Discussion:
[brlcad-devel] Some OGV improvements
Oleksandr Dubenko
2016-08-24 12:39:12 UTC
Permalink
Hi,
After coding period ended I decided to take a look at OGV.
First of all I made OGV merge all '.g' files into one. It made huge
difference. For example currently 'truck.g' loads for about 28s (365 obj
files). Merged file loads in less than a second.
Next I wanted to improve performance because model viewer lags badly. I
disabled AA and set device pixel ratio for WebGLRenderer. Also currently it
renders scene every frame but we don't need it. It should render only if
scene changes or we interact with it (e.g. rotate). I disabled rendering
for every available frame and performance improved dramatically. I'm going
to improve code to make sure it always displays scene correctly and I'll do
PR shortly.
Inderpreet Singh
2016-08-24 15:44:49 UTC
Permalink
Post by Oleksandr Dubenko
Next I wanted to improve performance because model viewer lags badly. I
disabled AA and set device pixel ratio for WebGLRenderer. Also currently it
renders scene every frame but we don't need it. It should render only if
scene changes or we interact with it (e.g. rotate). I disabled rendering for
every available frame and performance improved dramatically. I'm going to
improve code to make sure it always displays scene correctly and I'll do PR
shortly.
Wow! That's great Oleksandr. I really appreciate it. These are two of
the most needed requirements of OGV at the time. I have seen your PR
and I will review it shortly.

@Gaurav, can you also please take a look at it and help me in merging
it properly.


--
Inderpreet Singh

Ekoankar Sahai
ishwerdas.com
facebook.com/okayinder
https://kippt.com/okayinder

------------------------------------------------------------------------------
Oleksandr Dubenko
2016-08-30 17:46:35 UTC
Permalink
I deployed OGV on my server <http://ogv.esde.name/> (with new changes) so
everyone can checkout. Link directly to the model for the lazy
<http://ogv.esde.name/models/dEL9oKkf8pqj75mdg> ;)

For the next month, until new semester starts, I plan to contribute more to
OGV. I shared some ideas in my recent blog post
<https://blog.esde.name/ogv-ideas/>. I also really want to set up Slack
team because mail is kinda slow. Let me know what you think.
Post by Inderpreet Singh
Post by Oleksandr Dubenko
Next I wanted to improve performance because model viewer lags badly. I
disabled AA and set device pixel ratio for WebGLRenderer. Also currently
it
Post by Oleksandr Dubenko
renders scene every frame but we don't need it. It should render only if
scene changes or we interact with it (e.g. rotate). I disabled rendering
for
Post by Oleksandr Dubenko
every available frame and performance improved dramatically. I'm going to
improve code to make sure it always displays scene correctly and I'll do
PR
Post by Oleksandr Dubenko
shortly.
Wow! That's great Oleksandr. I really appreciate it. These are two of
the most needed requirements of OGV at the time. I have seen your PR
and I will review it shortly.
@Gaurav, can you also please take a look at it and help me in merging
it properly.
--
Inderpreet Singh
Ekoankar Sahai
ishwerdas.com
facebook.com/okayinder
https://kippt.com/okayinder
------------------------------------------------------------------------------
_______________________________________________
BRL-CAD Developer mailing list
https://lists.sourceforge.net/lists/listinfo/brlcad-devel
Inderpreet Singh
2016-08-30 19:51:25 UTC
Permalink
Post by Oleksandr Dubenko
For the next month, until new semester starts, I plan to contribute more to
OGV. I shared some ideas in my recent blog post. I also really want to set
up Slack team because mail is kinda slow. Let me know what you think.
You are on fire, man! Love it. ;)

Can you please share details of your server? Operating System, it's
version and so on.

I find e-mail fine, but I understand your point too. I would advice
you to chat on IRC, for instant messaging. Many of us are old-dogs
here ;) and sometimes choose to not have a machine with browser
installed. So we need something that at-least has an option to be run
from terminal.

Regarding future OGV improvements, please let's discuss. You are doing
great job and I don't want any of your effort go wasted because of
lack of communication from my side. Let's schedule a time on IRC (if
you prefer chat), discuss things and then move forward.

P.S loved your work on website too. Will be sharing my feedback for that.

@Gaurav, I read on your blog post that you have been assigned via your
school to work on OGV for next whole semester. Please sync with
Oleksander.

--
Inderpreet Singh

Ekoankar Sahai
ishwerdas.com
facebook.com/okayinder
https://kippt.com/okayinder

------------------------------------------------------------------------------
Gauravjeet Singh
2016-08-31 08:43:05 UTC
Permalink
Post by Inderpreet Singh
@Gaurav, I read on your blog post that you have been assigned via your
school to work on OGV for next whole semester. Please sync with
Oleksander.
Ah! Great.
Let's make OGV awesome together :)
--
Fear is wisdom in the face of danger. It’s nothing to be ashamed of

Gauravjeet Singh
http://github.com/gauravjeetsingh

------------------------------------------------------------------------------
Oleksandr Dubenko
2016-08-31 11:09:11 UTC
Permalink
Post by Inderpreet Singh
Can you please share details of your server? Operating System, it's
version and so on.
It's a simple VPS (2x2.66GHz, 1 GB ram and 30 GB SSD) with Ubuntu 14.04
installed.

Many of us are old-dogs here ;) and sometimes choose to not have a machine
Post by Inderpreet Singh
with browser installed.
Developing webapp without browser is hardcore :D
IRC is fine, I like it, but I think Slack provides better environment for
developing and can attract new people. I'm not insisting it's just a
thought for future.
Inderpreet Singh
2016-08-31 11:59:08 UTC
Permalink
Post by Oleksandr Dubenko
Developing webapp without browser is hardcore :D
Ha! I was referring to wider BRL-CAD community.
Post by Oleksandr Dubenko
IRC is fine, I like it, but I think Slack provides better environment for
developing and can attract new people. I'm not insisting it's just a thought
for future.
Yeah sure, it's good to go from my end.

As long as the conclusion to crucial discussions that happen on slack
are recorded as to-do list or as a page in wiki somewhere.

--
Inderpreet Singh

Ekoankar Sahai
ishwerdas.com
facebook.com/okayinder
https://kippt.com/okayinder

------------------------------------------------------------------------------
Gauravjeet Singh
2016-08-31 08:41:45 UTC
Permalink
Post by Inderpreet Singh
@Gaurav, can you also please take a look at it and help me in merging
it properly.
Hello!

Good work Oleksandr.
I still need to take a bit deeper look into the code.

Also, this disrupts the working of show/hide tools.
We need to find the way to have the obj for each part too and render
them only when working with show/hide tools.

p.s. I had sent this mail earlier, but due to some network problem, it
was still in drafts. Sorry for the delay.
--
Fear is wisdom in the face of danger. It’s nothing to be ashamed of

Gauravjeet Singh
http://github.com/gauravjeetsingh

------------------------------------------------------------------------------
Oleksandr Dubenko
2016-09-01 16:50:41 UTC
Permalink
Post by Gauravjeet Singh
Also, this disrupts the working of show/hide tools.
We need to find the way to have the obj for each part too and render
them only when working with show/hide tools.
I thought about it, but more about being able to color separate parts. And
I think I got a solution.
The .g file contains info not only about geometry but also about color. So
I created new converting script from scratch that converts g to obj and
adds colors. More details in blog post
<https://blog.esde.name/i-need-colors/>. It's a separate script for testing
purpose. Is it worth to integrate this conversion into OGV? I think it
would be nice.

I also set up a Slack team. I don't expect everyone to join but I hope we
could discuss OGV stuff there (in #ogv room), anyway everyone is welcomed :)
To get an invite click here <https://brl-cad.herokuapp.com/>. There is also
a terminal interface <https://github.com/evanyeung/terminal-slack> for
slack if you prefer.
Christopher Sean Morrison
2016-09-08 02:18:36 UTC
Permalink
I thought about it, but more about being able to color separate parts. And I think I got a solution.
The .g file contains info not only about geometry but also about color. So I created new converting script from scratch that converts g to obj and adds colors. More details in blog post. It's a separate script for testing purpose. Is it worth to integrate this conversion into OGV? I think it would be nice.
If it preserves the original colors, then absolutely! That'd be an improvement. Did you handle the override flag? How do you identify the color?
I also set up a Slack team. I don't expect everyone to join but I hope we could discuss OGV stuff there (in #ogv room), anyway everyone is welcomed :)
No thanks. I prefer to utilize open source when adequate. Appreciate your proactive enthusiasm, though.

Cheers!
Sean
Oleksandr Dubenko
2016-09-13 16:46:38 UTC
Permalink
Post by Christopher Sean Morrison
If it preserves the original colors, then absolutely! That'd be an
improvement. Did you handle the override flag? How do you identify the
color?
I get the RGB color from .asc files from this types of lines.

attr set {zz.r} {color} *{0/0/255}* {region} {R} {sh...

And I'm not sure what override flag is.


I want to share the progress I made in past few days on OGV. First I
configured ESLint to match meteor's code style
<https://guide.meteor.com/code-style.html> and fixed all the errors it
would detect. Next I restructured the app using meteor's recommendations on
file structure <https://guide.meteor.com/structure.html> and configured
Travis CI ( for now it's just linting the code but in the future it will
run tests). I also made a build script
<https://github.com/sniok/OGV-meteor/blob/eslint/scripts/build.sh> to
deploy OGV the right way and not just running development version in
production. Right now I'm working on UI improvements.

I'm working in a eslint branch in my repo here
<https://github.com/sniok/OGV-meteor/tree/eslint>. More detailed info about
things I did you can read in my blog <https://blog.esde.name/>.
Gauravjeet Singh
2016-10-09 07:47:13 UTC
Permalink
On Wed, Aug 31, 2016 at 2:11 PM, Gauravjeet Singh
Post by Gauravjeet Singh
I still need to take a bit deeper look into the code.
I was testing with various g files, the merging doesn't work for all g
files that come with BRL-CAD installation.
When I uploaded the file, truck.g, merging and conversion worked pretty fine.
But when I upload the file toyjeep.g, I get the following error

nmg_bool(): Dangling faces detected in rA after boolean
conversion of /all/detail_windshield/detail_ws.r1 FAILED!

ERROR: bad pointer 0xf74290: s/b union tree(x91191191), was
Zero_Magic_Number(x0), file
/home/jordi/Escriptori/brlcad-7.24.2/src/librt/db_tree.c, line 1339

@Oleksandr
Can you share the merging logic in simple language so that anyone
without meteor knowledge can review it?
We can then know if the reason for such error is the wrong approach
for merging or faulty example file.
--
Fear is wisdom in the face of danger. It’s nothing to be ashamed of

Gauravjeet Singh
http://github.com/gauravjeetsingh
Oleksandr Dubenko
2016-10-09 10:53:17 UTC
Permalink
Post by Gauravjeet Singh
When I uploaded the file, truck.g, merging and conversion worked pretty fine.
But when I upload the file toyjeep.g, I get the following error
That is the same error you mentioned before, isn't it?
https://www.mail-archive.com/brlcad-***@lists.sourceforge.net/msg05983.html

Can you share the merging logic in simple language so that anyone
Post by Gauravjeet Singh
without meteor knowledge can review it?
Sure. Before it converted every part of the object like this:
g-obj -o out1.obj in.g PART-1
g-obj -o out2.obj in.g PART-2
...
g-obj -o outN.obj in.g PART-N

Which resulted in N obj files. But g-obj can convert multiple parts at once
like this:
g-obj -o out.obj in.g PART-1 PART-2 ... PART-N
So g-obj is responsible for merging.

The dangling faces error was present before changing the convertion logic.
Gauravjeet Singh
2016-10-09 10:59:38 UTC
Permalink
Post by Oleksandr Dubenko
That is the same error you mentioned before, isn't it?
Yeah, Earlier on facing this error, I made an assumption that my
merging approach is wrong, so I started finding other ways to merge
them.
Post by Oleksandr Dubenko
g-obj -o out1.obj in.g PART-1
g-obj -o out2.obj in.g PART-2
...
g-obj -o outN.obj in.g PART-N
Which resulted in N obj files. But g-obj can convert multiple parts at once
g-obj -o out.obj in.g PART-1 PART-2 ... PART-N
So g-obj is responsible for merging.
The dangling faces error was present before changing the convertion logic.
@Sean or any g-obj developers

Any comment here ?
--
Fear is wisdom in the face of danger. It’s nothing to be ashamed of

Gauravjeet Singh
http://github.com/gauravjeetsingh
Oleksandr Dubenko
2017-01-24 16:49:35 UTC
Permalink
Update on importing '.g' files with colors.
First of all, I made little improvement in converting to obj. Instad of
passing all parts to g-obj it now passes only top-level objects (tops).
Then I started wokring on importing color from .g to .mtl file (Materials
file for .obj). Picking colors from .asc file was bad idea because handling
color inheritance was difficult. Instead I used mged's tree command with -a
argument which provides detailed tree of an object. Then converted it into
JSON tree (which is also can be used to do make a tree menu in OGV like in
Archer) and generated .mtl file from it. Also inserted ident-based colors
from "prcolor" command. Next steps are combining it with shaders (which
should be fairly easy with JSON tree) and making edit menu where user can
edit each part separately (while having single .obj file).

You can compare results here
<https://blog.esde.name/importing-colors-from-g-file/>
JSON tree of axis.g
<https://gist.github.com/sniok/2770285f7c4f8dc1fcf108509fcec7d0>
Github branch <https://github.com/sniok/OGV-meteor/tree/eslint>

Did I miss something? Are there any other color/material settings?
Post by Gauravjeet Singh
Post by Oleksandr Dubenko
That is the same error you mentioned before, isn't it?
Yeah, Earlier on facing this error, I made an assumption that my
merging approach is wrong, so I started finding other ways to merge
them.
Post by Oleksandr Dubenko
g-obj -o out1.obj in.g PART-1
g-obj -o out2.obj in.g PART-2
...
g-obj -o outN.obj in.g PART-N
Which resulted in N obj files. But g-obj can convert multiple parts at
once
Post by Oleksandr Dubenko
g-obj -o out.obj in.g PART-1 PART-2 ... PART-N
So g-obj is responsible for merging.
The dangling faces error was present before changing the convertion
logic.
@Sean or any g-obj developers
Any comment here ?
--
Fear is wisdom in the face of danger. It’s nothing to be ashamed of
Gauravjeet Singh
http://github.com/gauravjeetsingh
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
BRL-CAD Developer mailing list
https://lists.sourceforge.net/lists/listinfo/brlcad-devel
Christopher Sean Morrison
2016-09-13 17:51:09 UTC
Permalink
On Sep 13, 2016, at 12:47 PM, Oleksandr Dubenko <***@gmail.com> wrote:


If it preserves the original colors, then absolutely!  That'd be an improvement.  Did you handle the override flag?  How do you identify the color?

I get the RGB color from .asc files from this types of lines.

attr set {zz.r} {color} {0/0/255} {region} {R} {sh...

And I'm not sure what override flag is.



You stopped too soon.  :)  Further down that attr set line is an inherit flag (which will be 0/unset or 1).  If inherit is set, then it overrides anything lower.



Example hierarchy:



top1 (color=red, inherit not set)

  u obj1 (color=green)

  u obj2 (color is unset)

top2 (color=blue, inherit=1)

  u obj1 (color=green)

  u obj3 (color is yellow)



Here's what colors should be seen if I draw each object:



draw obj1 => obj1: green

draw obj2 => obj2: gray

draw obj3 => obj3: yellow

draw top1 => obj1: green, obj2: red

draw top2 => obj1: blue, obj3: blue



Basically, what color they should be shown as depends on what exactly is drawn, what the context is.  If I draw "/obj3", I get yellow, but drawing "/top2/obj3" gives blue.  Make sense?


 
I want to share the progress I made in past few days on OGV. First I configured ESLint to match meteor's code style and fixed all the errors it would detect. Next I restructured the app using meteor's recommendations on file structure and configured Travis CI ( for now it's just linting the code but in the future it will run tests). I also made a build script to deploy OGV the right way and not just running development version in production. Right now I'm working on UI improvements. 

I'm working in a eslint branch in my repo here. More detailed info about things I did you can read in my blog.



Awesome, thanks for sharing the progress update!  Is it ready to be deployed on the production server?  Will your build script work?



Cheers!

Sean
Loading...