I have a huge application rendering a 3d scene in a c++ QGLWidget. Is it possible using Qt5 & webgl to add a scripting layer to the application in order to interactively "paint" on the QGLWidget? How?
In QGLWidget, you would use Native openGL API to draw, and input APIs to take input. In WebGL code, you would use WebGL (along with Canvas wrappers) to draw. What is the meaning of "interactive paint" operation here ?
Related
Im trying to make render to texture for reflection and refration texture for water shader... but glClipPlane is not defined in kivy opengl.. Here are some ScreenShots
Test with PyOpengl
Test with kivy Opengl
From Clipping-planes in OpenGL ES 2.0, it looks like this wasn't part of OpenGL ES 2.0, which Kivy nominally targets. If you do want to use it, you probably can, but it isn't part of Kivy's exposed API (these low level opengl calls are usually considered internal to Kivy).
How can I resize texture2d of SharpDX? I'm using SharpDX to Duplicate the screen and I use MediaFoundation to encode the texture into a video file. My problem is when I open an application into fullscreen and has a different resolution from system resolution I got a blank screen on my recording. Is there a better way I can resize the texture before encoding to mediafoundation without suffering performance? I'm using hardware accelerated. Thanks.
It depends on how exactly you use Media Foundation, but you can use the Video Processor MFT explicitly. You need to add this MFT to the topology if you use IMFMediaSession/IMFTopology. Or initialize and process the samples with this MFT if you use Sink Writer. In this case you need to supply the DX manager to the MFT, using MFT_MESSAGE_SET_D3D_MANAGER.
This MFT is only available on Windows 8 and higher. So if you need to support an older Windows version you can use Video Resizer, but it is not hardware accelerated.
Another option to resize the texture would be to create a render target of the desired size and draw the texture to it. After that you need to feed that render target to the encoder.
I'm just new to Stagexl and Dart.
I'm reading the little starting guide on stageXL.org (http://www.stagexl.org/docs/getting-started.html) and I'm trying the sample code to draw a red circle and it doesn't work (the canvas is empty).
None of the samples I found on some page didn't work.
For example, this one with the four square: http://www.stagexl.org/docs/wiki-articles.html?article=introduction, the canvas is always empty..
Need some help ..
If you know a good tutorial for learning StageXl please share it to me !
Thanks.
The current version of StageXL (version 0.12) does not support vector graphics when the WebGL renderer is used. Please opt-out from the WebGL renderer and use the Canvas2D renderer like this:
// do this before the Stage constructor is used
StageXL.stageOptions.renderEngine = RenderEngine.Canvas2D;
The next versions of StageXL (starting with 0.13) will support more vector graphics commands even when the WebGL renderer is used. Please be aware that WebGL is optimized for rendering textures (Bitmap/BitmapDatas) and drawing vector graphics may be a costly operation depending on the use case.
This is my first iPhone/iPad app :S
It is a drawing app and I would like that user could save the current work and after that continue drawing on that same image (updating).
I already did something based on this and this. This uses Quartz.
So I would have to save it to some format that can be read back into the memory and displayed on the screen for updating (user draws another line or erases some before).
The images would be saved on server and I would like it to be in a format that in future Android devices also can read it (just read it, not update).
Also, a lot of transformations is going to be on that images after they are finished drawing (scale, projection...). I found that Open GL ES is great for this transformations --> Open GL ES
So the question is,
should I use Quartz for drawing since it is simple and convert the image somehow to Open GL because Open GL is good for transformations? And in which format to save the drawing so it could be used latter for updating and that Android devices could also read it?
To port to android latter Quartz won't help you, openGL is faster, in this case more portable and great for transformations (and effects, even better with ES 2.0 and shaders).
However if you haven't used openGL yet it's quite a different journey from quartz, so maybe read some tutorials on programming in openGL first to get a fell for it.
I know I can do it with GLUT. But, I have a big project and I had problem adding GLUT (I am using Delphi) to it.
So, what other options do I have?
You can't do it with standard OpenGL functions, unless you basically have textures with text in them, or a list of characters on a texture that you draw from. But don't reinvent the wheel - I would recommend FTGL for rendering text in an OpenGL view. It has several different rendering methods and takes care of things like kerning for you, supports unicode, and has good text metrics features too.
Use TextSuite. http://textsuite.opengl24.de/
Use FreeType to yield a bitmap given your text.
Edit: It is a mature cross platform library that brings a complete text display capabilities based on fonts including normal Windows TrueType fonts. Here is its definition from Wikipedia:
FreeType is a software library written
in C that implements a font
rasterization engine. It is used to
rasterize characters into bitmaps and
provides support for other
font-related operations.
If you do decide to implement your own font system be sure to use a texture atlas, I've seen too many OpenGL demos that use one texture per glyph, which leads to atrocious performance (due to the overheads incurred in the OpenGL driver and texture caches).