Search the Community
Showing results for tags 'stencil'.
-
Hello, is it possible to do a stencil test while rendering to a 2d texture. This is my example code: camera->setModelview(Unigine::Math::inverse(m_player->getWorldTransform())); // saving current render state and clearing it Unigine::RenderState::saveState(); Unigine::RenderState::clearStates(); Unigine::RenderState::clearBuffer(Unigine::RenderState::BUFFER_STENCIL, Unigine::Math::vec4(), 0.f, 1); Unigine::RenderState::setStencilFunc(Unigine::RenderState::STENCIL_EQUAL, Unigine::RenderState::STENCIL_KEEP, 2); Unigine::RenderState::flushStates(); // rendering an image from the camera to the texture viewportwide->renderTexture2D(camera, texture); // restoring back render state Unigine::RenderState::restoreState(); The stencil function I use should skip filling the texture, but it still works. What am I doing wrong?
-
Hi, I'm trying to use WidgetSpriteVideo to display video on in-game screen models and it works pretty fine. However, I can't have the video cropped properly. As I show on my screenshot, I'd like the right part of the video not being displayed. I've made some research, found this topic and tried to do the same. Here is the code in which I try to create my WidgetSpriteVideo and attach it to my GuiObject: // gui: Gui of my ObjectGui WidgetHBox container = new WidgetHBox(gui); container.setStencil(1); WidgetSpriteVideo videoSprite = new WidgetSpriteVideo(gui, "MyVideo.ogv", 0); videoSprite.setFlags(GUI_ALIGN_OVERLAP); container.addChild(videoSprite); gui.addChild(container); What am I missing? Thanks, Alexandre.
-
Hey Unigine, stencil isn't working for sprites. <hbox stencil="1" width="10" export="1" name="statusbarLayer"> <sprite texture="imagepath.png"/> </hbox> If I'm using a label: <hbox stencil="1" width="10" export="1" name="statusbarLayer"> <label><text>012345678910111213</text></label> </hbox> it work's neither. (updated) In my opinion thats a bug isn't it? PS: I tried to set the align in texture like: align="expand" etc. and it didn't work aswell. Greetings Lars