Objects only rendered in Left orthographic view - import

HOW THE Viewports look after loading the file:
I am having an issue caused by extremely large objects (in terms of physical size not polycount etc.) that I imported from a game using ninjaripper (a script used for extracting 3d models from games). When I open the file containing these large objects, the objects are only rendered in the left orthographic viewport. All other viewports/views do not show the geometry regardless of which rendering mode (wireframe, edges faces etc.) I have selected on said viewports. The objects are also not visible in perspective views. When I unhide all items apart from a single object (of normal size) I am able to see the object in all viewports including perspective viewports. When I unhide all again, the object which could previously be seen disappears. When switching to perspective view when these extremely large objects are present, the 'viewcube' disappears for an unknown reason. Zooming in or out in a perspective viewport also results in the viewcube disappearing. This is the only scene I've had so far which shows these issues, all my graphics drivers are up to date (specs listed below). The scene contains 3602 objects and has 1,957,286 polygons and 1,508,550 vertices.
This is the furthest I could zoom out in 3ds max:
Viewcube has disappeared on top right and bottom right viewport:
I tried removing all of the extremely large objects by hand, after which the remaining (normal sizes) objects could be seen in 2 of the viewports (top left and top right viewport did render correctly).
Viewports after having deleted all extremely large objects:
I tried resetting the scene, after which I merged the scene containing all 'normal sized objects' into an empty scene. This resulted in all viewports rendering the objects correctly. However, after saving the file and re-opening the saved file, 2 of the 4 viewports did not render the objects as was the case after just having deleted all but the 'normal sized' objects.
My question is: how should I deal with these extremely large imported objects in order to fix the viewport rendering issues they cause?
I wrote a simple bit of maxscript code to print out the maximum size of the biggest object in the scene, which resulted in a value of 2.6*10^38 [generic units], which, according to my calculation corresponds to a value of 6.6*10^36 [meters], in summary: extremely large. (I suspect the ninjaripper script or the script which imports the files produced by the ninjaripper into 3ds max had some sort of error causing some of the vertices to have extremely large position values). When I switch to the measure tap in 'utilities' and press Ctrl+A to select all objects in the scene (the scene containing all objects including the extremely large objects), 3ds max crashes due to the large object size (error message: "Application error- An error has occured and the application will now close. No Scene changes have occured since your last save.").
I could write some maxscript code which deletes all objects which are larger then a certain size (for example: 10^5 [meters]). However, as afore mentioned this for some reason does not fix the issue completely (after saving the scene with only 'normal sized' objects and re-opening the scene only 2 of the 4 viewports render the objects correctly. I ran the code for measuring the max size of the largest object in the scene again after having deleted all extremely large objects to check if I had indeed not skipped over one of these large objects, the result was a value of: 121.28 [generic units] (corresponding to object: "Mesh_3598") which is a relatively normal size, however 2 of my 4 viewports are not rendering my objects even after deleting the large objects (only when the left orthographic view is selected they can be seen in the 2 viewports that do not render part of the time).
Code for checking largest object (also prints out maximum size of this object):
global_max=0
largest_obj=undefined
for obj in geometry do(
obj_max_x = (obj.max.x-obj.min.x)
obj_max_y = (obj.max.y-obj.min.y)
obj_max_z = (obj.max.z-obj.min.z)
local_max = amax(#(obj_max_x, obj_max_y, obj_max_z ))
if local_max > global_max do
global_max = local_max ; largest_obj = obj
)
messagebox ("global max = " + global_max as string)
messagebox ("largest obj = " + largest_obj as string)
See the following links for the 3ds max scene files I have mentioned:
https://drive.google.com/open?id=1bAilmaHAXDr4WuD8gGS4piQfPzzJM9MH
Any suggestions/help will be greatly appreciated. Thank you very much!
System specs:
-Autodesk 3ds max 2018 x64
-Windows 10 PRO x64
-i5 6600k #3.5ghz
-msi z170a gaming m7 - socket 1151 - atx
-coolermaster g750m -750watt
-msi radeon r9-390x gaming -8gb
-noctua NH-D15
-kingston hyper-x fury black 16gb-pc-21300-dimm-4x4gb#2666mhz

As it turns out the extremely large objects were indeed causing the viewport rendering error. After removing all object's with a maximum size of 100000 [generic units] the viewport rendering errors were gone. I suspect the issue was caused by the objects not being in between the viewport's far and near planes due to the extremely large object sizes.

Related

How to scale up image where objects's size are remained same?

If you have a file which include objects for example for EE like transistors, resistors etc and if you group them into one and then from the corner drag it to zoom in a bigger figure.
How can I make sure that these components are not zoom in only wiring changes?
The problem is that I have like 30 images with different sizes and I'm placing them in a table with many images side by side. However, if I keep the same scale then some images looks small compared to other. So I tried to scale them to get the same size. However, this make the components's sizes are also scaled up with different scale factors.
Here is an example of circuit using the bult-in shapes in Visio. As you can see the components'sizes got bigger when I scaled up the object. This is usually desired. However, in my specific case I want to keep the component's size same.
Here is the Visio file or I think you can also use any available components in Visio.
https://file.io/VRUCR8yVgYxs

Optimizing masked scrollbar

I have a scrollbar with a mask.
Inside there are over 1000 UI elements scrolled - each has bg, icon, and text.
on top there are several UI elements spreaded out
when static, it runs at arounf 80fps
while scrollng, it runs at about 30fps
What i've tried
Atlassing all images
uniying materials - giving the same material to all elements (either 1 for all or 1 for the list and 1 for all the rest)
seperating canvases - 1 for the list and 1 for all the rest (only increased batches).
removed pixel perfect from canvas
Changed canvas from screenspace: camera to overlay.
Issues:
there are seperate batches for 2 objects under the reason "Different material instance"
although both objects are under the same canvas, same Z same material and same Image (and both read the same image from the same atlas on start).
the list of elements all contain an image taken as an index from a unified atlas.
However, I see 2 separate batches - 1 for the 15 elements not masked, and 1 for all the masked elements. is there a way to batch them together?
I'm looking for a way to optimize the masking of the element (for this is the heaviest component)
With the pixel perfect off - the fps moved from ~30fps while scrolling to anything between 60fps to 0.7fps

MRTK - Maximum number of 64 colliders found in PokePointer overlap query

I am trying to build a color selection list in my personal project, with 48 * PressableButtonHoloLens2 + GridObjectCollection. When I run and hover with the simulated fingertip, the editor gives me these warning messages.
Q1: Is this because too many buttons are too close to each other? Or just the number of the buttons with collider is over 64? The message says 'Consider increasing the query buffer size in the pointer profile'
Q2: Where can I increase the buffer size? I don't see any 'Buffer size' field in the pointer profile.
Q3: Would it decrease performance? (increasing the buffer size)
Warning message
Maximum number of 64 colliders found in PokePointer overlap query.
Consider increasing the query buffer size in the pointer profile.
UnityEngine.Debug:LogWarning(Object)
Microsoft.MixedReality.Toolkit.Input.PokePointer:FindClosestTouchableForLayerMask(LayerMask,
BaseNearInteractionTouchable&, Single&, Vector3&) (at
Assets/MixedRealityToolkit.SDK/Features/UX/Scripts/Pointers/PokePointer.cs:169)
Microsoft.MixedReality.Toolkit.Input.PokePointer:OnPreSceneQuery() (at
Assets/MixedRealityToolkit.SDK/Features/UX/Scripts/Pointers/PokePointer.cs:127)
Microsoft.MixedReality.Toolkit.Input.FocusProvider:UpdatePointer(PointerData)
(at
Assets/MixedRealityToolkit.Services/InputSystem/FocusProvider.cs:878)
Microsoft.MixedReality.Toolkit.Input.FocusProvider:UpdatePointers()
(at
Assets/MixedRealityToolkit.Services/InputSystem/FocusProvider.cs:841)
Microsoft.MixedReality.Toolkit.Input.FocusProvider:Update() (at
Assets/MixedRealityToolkit.Services/InputSystem/FocusProvider.cs:518)
Microsoft.MixedReality.Toolkit.<>c:b__60_0(IMixedRealityService)
(at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:880)
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:ExecuteOnAllServices(IEnumerable1,
Action1) (at
Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:969)
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:ExecuteOnAllServicesInOrder(Action`1)
(at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:950)
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:UpdateAllServices()
(at Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:880)
Microsoft.MixedReality.Toolkit.MixedRealityToolkit:Update() (at
Assets/MixedRealityToolkit/Services/MixedRealityToolkit.cs:580)
To reproduce
Create an empty game object
Put 48 x PressableButtonHoloLens2 prefabs under it
Assign GridObjectCollection to the parent
Update layout (cell width x height = 0.032)
Run and hover with simulated hand.
Expected behavior
No warning messages
Your Setup (please complete the following information)
Unity Version [e.g. 2018.4.6f1]
MRTK Version [e.g. v2.0.0]
https://github.com/microsoft/MixedRealityToolkit-Unity/issues/6052
Q1: Is this because too many buttons are too close to each other? Or just the number of the buttons with collider is over 64? The message says 'Consider increasing the query buffer size in the pointer profile'
It is because there are too many buttons close to each other.
Q2: Where can I increase the buffer size? I don't see any 'Buffer size' field in the pointer profile.
You can do this in the PokePointer prefab, in the PokePointer script, look for "Scene Query Buffer Size" field.
Q3: Would it decrease performance? (increasing the buffer size)
Yes I anticipate it would, though unclear how much relative to other components in the scene. Note that the poke pointer does run queries every frame, at least one per hand.

Monogame rendering text using Graphics.DrawString (instead of SpriteBatch.DrawString)

Is there any downside to using Graphics.DrawString to render a (rather static) bunch of text to an offscreen bitmap, convert it to a Texture2D once, and then simply call SpriteBatch.Draw, instead of using the content pipeline and rendering text using SpriteFont? This is basically a page of text, drawn to a "sheet of paper", but user can also choose to resize fonts, so this means I would have to include spritefonts of different sizes.
Since this is a Windows only app (not planning to port it), I will have access to all fonts like in a plain old WinForms app, and I believe rendering quality will be much better when using Graphics.DrawString (or even TextRenderer) than using sprite fonts.
Also, it seems performance might be better since SpriteBatch.DrawString needs to "render" the entire text in each iteration (i.e. send vertices for each letter separately), while by using a bitmap I only do it once, so it should be slightly less work at the CPU side.
Are there any problems or downsides I am not seeing here?
Is it possible to get alpha blended text using spritefonts? I've seen Nuclex framework mentioned around, but it's not been ported to Monogame AFAIK.
[Update]
From the technical side, it seems to be working perfectly, much better text rendering than through sprite fonts. If they are rendered horizontally, I even get ClearType. One problem that might exist is that spritesheets for fonts are (might be?) more efficient in terms of texture memory than creating a separate texture for a page of text.
No
There doesn't seem to be any downside
In fact you seem to be following a standard approach to text rendering.
Rendering text 'properly' is a comparatively slow processed compared to rendering a textured quad, even though SpriteFonts cutout all the splining glyphs, if you are rendering a page of text then you can still be racking up a large number of triangles.
Whenever I've been looking at different text rendering solutions for GL/XNA, people tend to recommend your approach. Draw your wall of text once to a reusable texture, then render that texture.
You may also want to consider RenderTarget2D as possible solution that is portable.
As an example:
// Render the new text on the texture
LoadPageText(int pageNum) {
string[] text = this.book[pageNum];
GraphicsDevice.SetRenderTarget(pageTarget);
// TODO: draw page background
this.spriteBatchCache.Begin();
for (int i = 0; i < text.Length; i++) {
this.spriteBatchCache.DrawText(this.font,
new Vector2(10, 10 + this.fontHeight * i),
text[i],
this.color);
}
this.spriteBatchCache.End();
GraphicsDevice.SetRenderTarget(null);
}
Then in the scene render, you can spriteBatch.Draw(..., pageTarget, ...) to render the text.
This way you only need 1 texture for all your pages, just remember to also redraw if your font changes.
Other things to consider is your SpriteBatches sort mode, sometimes that may impact performance when rendering many triangles.
On point 2, as I mentioned above the SpriteFonts are pre-rendered textures, this means that the transparency is baked onto their spritesheet. As such it seems the default library uses no transparency/anti-aliasing.
If you rendered them twice as large and White on Black and used the SourceColor as an alpha channel then rendered them scaled back down blending with Color.Black you could possible get it back.
Please try color mixing with pointer:
MixedColor = ((Alpha1 * Channel1) + (Alpha2 * Channel2))/(Alpha1 + Alpha2)

Relative to tallest object option not working when frame shrinks

In the report, there are two frames that are in the same group and have selected Relative To Tallest Object option.
In the case, where one of the frames is extended because of the content overflow, the second frame extends relative to first frame.
In the case, when the first of the frames will shrink because of deleted text boxes from inside, that have Remove Line When Null option set, the height of the frame is reduced, despite the fact, that the Relative To Tallest Object option should ensure, that the size of the first frame is the same as the highest frame in group.
Problem occurs in JasperReports 4.7.1.
What can I do to get around this?
Image representing the problem:
Content was erased due to privacy concerns.