Beispiel #1
0
// threadId of -1 means run all threads.  Otherwise, run just the 
// indicated thread.
static void runUntilInterrupt(Core *core, int threadId, int enableFbWindow)
{
	fd_set readFds;
	int result;
	struct timeval timeout; 

	FD_ZERO(&readFds);

	while (1)
	{
		if (!executeInstructions(core, threadId, 500000))
			break;

		if (enableFbWindow)
		{
			updateFB(getCoreFb(core));
			pollEvent();
		}
		
		FD_SET(gClientSocket, &readFds);
		timeout.tv_sec = 0;
		timeout.tv_usec = 0;
		result = select(gClientSocket + 1, &readFds, NULL, NULL, &timeout);
		if ((result < 0 && errno != EINTR) || result == 1)
			break;
	}
}
Beispiel #2
0
    void FrameBuffer::postCommit(RenderContext &)
    {
      bool removeToneMapper = false;
      bool toneMapperEnabled = false;
      if (hasChild("toneMapper")) {
        toneMapperEnabled = child("toneMapper").child("enabled").valueAs<bool>();
        if (toneMapperActive && !toneMapperEnabled)
          removeToneMapper = true;
      }
      // Avoid clearing the framebuffer when only tonemapping parameters have been changed
      if (lastModified() >= lastCommitted()
          || child("size").lastModified() >= lastCommitted()
          || child("displayWall").lastModified() >= lastCommitted()
          || child("useAccumBuffer").lastModified() >= lastCommitted()
          || child("useVarianceBuffer").lastModified() >= lastCommitted()
#ifdef OSPRAY_APPS_ENABLE_DENOISER
          || child("useDenoiser").lastModified() >= lastCommitted()
#endif
          || child("colorFormat").lastModified() >= lastCommitted()
          || removeToneMapper)
      {
        std::string displayWall = child("displayWall").valueAs<std::string>();
        this->displayWallStream = displayWall;

        updateFB();

        if (displayWall != "") {
          // TODO move into own sg::Node
          ospLoadModule("displayWald");
          OSPPixelOp pixelOp = ospNewPixelOp("display_wald");
          ospSetString(pixelOp, "streamName", displayWall.c_str());
          ospCommit(pixelOp);
          ospSetPixelOp(ospFrameBuffer, pixelOp);
          std::cout << "-------------------------------------------------------"
                    << std::endl;
          std::cout << "this is the display wall framebuffer .. size is "
                    << size() << std::endl;
          std::cout << "added display wall pixel op ..." << std::endl;

          std::cout << "created display wall pixelop, and assigned to frame buffer!"
                  << std::endl;
        }
        ospCommit(ospFrameBuffer);
      }

      if (toneMapperEnabled && !toneMapperActive) {
        ospSetPixelOp(ospFrameBuffer, child("toneMapper").valueAs<OSPPixelOp>());
        toneMapperActive = true;
      }
    }
Beispiel #3
0
    FrameBuffer::FrameBuffer(vec2i size)
    {
      createChild("size", "vec2i", size, NodeFlags::gui_readonly);
      createChild("displayWall", "string", std::string(""));

      std::vector<Any> whiteList;
      for(auto const& el : colorFormats)
        whiteList.push_back(el.first);
      createChild("colorFormat", "string", whiteList[0],
                  NodeFlags::required |
                  NodeFlags::gui_combo,
                  "format of the color buffer");
      child("colorFormat").setWhiteList(whiteList);

      createChild("useAccumBuffer", "bool", true);
      createChild("useVarianceBuffer", "bool", true);
#ifdef OSPRAY_APPS_ENABLE_DENOISER
      createChild("useDenoiser", "bool", true);
#endif

      updateFB();
    }