Exclude certain modules in deep rendering - enzyme

I'm using jest snapshot comparison in combination with enzyme mount rendering. Is it possible to define a list of components which will be excluded from deep rendering?

Related

Directx11 How to manage multiple vertex/index buffers?

I'm Working on a small game framework as I am learning DirectX11.
What could be the best method to have a BufferManager class (maybe static) to handle all the vertex and index data of the models created both in real time or before. The class should be responsible for creating the Buffers dynamic or static, depending on the model info and then drawing them.
Should I have one vertex and index vector list and append all the new models to it... and then recreate the buffers, whenever new data is appended and set the new buffers before drawing.
Should I have seperate vertex and index buffers for the models, access respective model's buffer and set to IASetVertexBuffer(model[i].getVertBuff()) before each draw call;
Also some models could be dynamic and others static, how can I do batching here?
Not showing any code here but the construct that you are requesting would be as follows:
Create a file loader for, textures, model meshes, vertex data, normal, audio, etc.
Have a reusable structure that stores all of this data for a particular mesh of a model.
When creating this you will also want a separate texture class to hold information about different textures. This way the same texture can be referenced for different models or meshes and you won't have to load them into memory each time.
The same can be done about different meshes; you can reference a mesh that may be a part of different model objects.
To do this you would need an Asset Storage class that will manage all of your assets. This way if an asset is already in memory it will not load it again; such as a font, a texture, a model, an audio file, etc.
Then the next part you will need is a Batch class and a Batch Manager class
The batch class will define the container of what a batch is based off of a few parameters: Primitive types, if they have transparencies or not (priority queue) etc.
The Batch Manager class will do the organization and send the batches to the rendering stage. This class will also be used to state how many vertices a batch can hold and how many batches (buckets) you have. The ratio will depend on the game content. A good ratio for a basic 2D sprite type application would be approximately 10 batches where each batch contains not less than 10,000 vertices. The next step would be then to populate a bucket of similar types based on Primitive Type and its Priority (alpha channel - for Z depth), and if a bucket can not hold the data it will then look for another bucket to fill. If no buckets are available to hold the data, then the Batch Manager will look for the bucket that is most filled with the highest priority queue, it will send that batch to the video card to be rendered, then it will reuse that bucket.
The last part would be a ShaderManager class to manage different types of shaders that your program will use. So all of these classes or structures will be tied together.
If you design this appropriately you can abstract all of the Engines behaviors and responsibilities away from the actual Game Content, Properties and Logic or set of Rules. This way your Game Engine can be reusable for multiple games. That way your engine doesn't have any dependencies on a particular game and when you are ready to reuse it all you have to do is create a main project that inherits from either this Static or Dynamic library and all of the Engine Components will be incorporated into the next game. This separation of code is an excellent approach for generic reusable code.
For an excellent representation of this approach I would suggest checking out this website www.MarekKnows.com and follow the Shader Engine series of video tutorials. Albeit this particular website focuses on a Win32 in C++ but uses OpenGL instead of DirectX. However the overall design pattern has the same concept. The only difference would be to strip out the OpenGL parts and replace them with the DirectX API.
EDIT - Additional References:
Geometric Tools
Rastertek
3D Buzz
Learn OpenGL
GPU Gems by NVidia
Batches PDF by NVidia
Hieroglyph3 # Codeplex
I also found this write up on Batch Rendering Process that is by Marek Krzeminski which is from his video tutorials but found here Batch Rendering by Marek at Gamedev

Chromium/WebKit render to OpenGL texture

Last few days I have been looking around the chromium and WebKit source codes, reading wikis, and watching Google videos. What I want to do is take what WebKit renders and place it into a GL texture. But I need to have different DOM nodes in different textures. I have a few questions and Im not sure if I should go about using Chromium or implementing my own simple browser. Chromium obviously has many nice features, but it is very large and extensive. I also figure that it's algorithms for splitting render layers are unpredictable (I want pretty much full control).
Where should in WebKit or Chromium's source to find where it outputs raster data? It would be convenient if I could get access to Chromium's render layer raster data before it is composted. But as I said the render layers would probably me mixed in a way I didn't want them to be.
Is WebKit GPU accelerated, in that case I should be able to access the data directly. I know Chromium+Blink is but I can't find out if WebKit on its own is.
How much work is it too put together a simple browser?
P.S. I can't use Awesomium because I need to render different DOM nodes/subtrees into different textures. Chromium Embedded Framework doesn't appear to have support for DOM manipulation either and I believe it just renders the entire page and gives you the raster data.

Advice on setting up a Qt3D scene with redundant objects

I'm new to the Qt3D module and am currently writing a game in Qt5/C++ using Qt3D. This question is about "Am I on the correct path?" or "Can you give me some advice on...".
The scene of the game has a static part (the "world") and some objects (buildings and movable units). Some of the buildings might be animated in the future, but most of them are very static (but of course destructible).
I divide the quesion into two parts: How to handle copies of the same model placed at different positions in the scene and how to manage the scene as a whole in the viewer class.
Redundant objects in the scene:
Of course the objects share the same library of buildings / movable units, so it would be dumb to upload the models for these objects to the graphics card for every instance of such a unit. I read through the documentation of QGLSceneNode, from which I guess that it is designed to share the same QGeometryData among multiple scene nodes, but apply different transformations in order to place the objects at different positions in my scene. Sharing the same QGLSceneNode for all instances of a building would be the wrong way, I guess.
I currently have a unit "library class" telling me the properties of each type of building / movable unit, among other things the geometry including textures. Now, I'd provide a QGeometryData for each building in this library class, which is uploaded on the loading procedure of the game (if I decide to do this for all buildings at startup...).
When creating a new instance of a unit, I'd now create a new QGLSceneNode, request the QGeometryData (which is explicitly shared) from the library and set it on the node. Then I set the transformation for this new node and put it in my scene. This leads us to the second part of my question:
Manage the scene as a whole:
My "scene" currently is neither a QGLSceneNode nor a QGLAbstractScene, but a struct of some QGLSceneNodes, one for each object (or collection of objects) in the scene. I see three approaches:
My current approach, but I guess it's "the wrong way".
The composition: Putting everything as child nodes in one root QGLSceneNode. This seemed the correct way for me, until I realized that it is very difficult to access specific nodes in such a composition. But when would I even need to access such "specific" nodes? Most operations require to take all nodes into account (rendering them, updating positions for animations), or even operate on a signal-slot-basis so I even don't need to find the nodes manually at all. For example, animations can be done using QPropertyAnimations. Acting on events can also be done by connecting a QObject in the game engine core (all buildings are QObjects in the engine's core part) with the corresponding QGLSceneNode.
But this approach has another downside: During rendering, I might need to change some properties of the QGLPainter. I'm not sure which properties I need to change, this is because I don't know Qt3D enough and can't guess what can be done without changing the properties (for example: using a specific shader to render a specific scene node).
Then I found QGLAbstractScene, but I can't see the advantages when comparing with the two solutions above, since I can't define the rendering process in the scene. But maybe it's not the correct location where to define it?
Which is the best approach to manage such a scene in Qt3D?
With "best" I mean: What am I going to do wrong? What can I do better? What other things should I take into account? Have I overlooked anything important in the Qt3D library?

X11 Compositor / Layer manager

I have n applications with GUIs made in different technologies.
This is what I want to do -
Render all application windows off-screen using a compositor (If I am using the term correctly).
Then combine them to form a single layer to display after applying several operations like re-sizing, changing opacity, angle etc.
Language of implementation : C++ with XLib
Can someone give me an idea how I should proceed with this ?
Also, I had trying doing this also and succeeded with some help from Stack Overflow-
[ X11 layer manager ]
Create n layers, one for each application, onto which applications draw.
Have a layer manager which can perform operations on each of these layers
(like re sizing, changing opacity etc. ) and then combine them to form a
single layer.
Is there an advantage in terms of performance if I use the first approach ( rendering the application output myself than allowing them to do so on their own ) ? And how exactly can this be achieved.

c/c++ application importing 3d models from modelling softwares at runtime

I am an openGL beginner. I need to build a c/c++ application which displays 3d models in augmented reality. For AR i'm using ARToolkit. In the app it must import 3d models built with modelling softwares like blender,sketchup etc.. the models might be .obj,.3ds,.collada(suggest me any others if any??).
ARToolkit mainly uses opengl to render(AFAIK), the 3d objects to camera input.
Is it possible to load 3d models/objects at runtime dynamically. what libraries are existing if any for this?
I want to have keyboard interaction with the models also where i can move specific parts of the model(eg: rrotate wheels of a car)
The models here maybe as simple as a simple house to character(man/woman).suggest me the resources i need for this and any technicalities i missed. I prefer if possible my code to work with opengl 1.4
You will need some import mechanism to import meshes in various formats into your runtime format. OpenGL (or DirectX) doesn't specify how your meshes must look on disk, and there is various stuff stored on disk that is not required for rendering. Basically, you need a way to get the vertex positions and attributes from the file, and optionally an index list (if you render using indexed triangle lists, which you probably should be doing.)
The easiest for sure is .obj, which is an ASCII format that you can easily parse and which is supported by many applications. Otherwise, look at libraries like Open Asset Import.
However, I would assume you are looking for an OpenGL based rendering system, which does the rendering for you as well as the mouse interaction. There are lot of existing engines you can use out there, for instance, Ogre3D or IrrLicht. IrrLicht is easy to use and provides support for a bunch of the formats you mentioned. It you must stick with ARToolkit for rendering, then you can probably easily convert the formats from either engine to whatever ARToolkit expects.
I'm very recomending you to try http://assimp.sourceforge.net/lib_html/
It supports a lot of open/not-very-open data formats, skelet-animation, affine transfer animation, etc.