Giter Site home page Giter Site logo

lygyue / panoramaplugin Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 28.11 MB

There is a panorama plugin, which can build panorama image using all kind of resolution of input images.

C 21.14% C++ 78.86%
panorama panorama-stitching panorama-image panorama-camera

panoramaplugin's Introduction

PanoramaPlugin

There is a panorama plugin, which can build panorama image using all kind of resolution of input images.It likes Nvidia's "ansel", ansel impelement in driver and must open a dialog to config. My plugin using in a simple way.

#pragma once
#define				API_EXPORT			extern "C" __declspec(dllexport)
#define				DLL_CALLCONV			__stdcall

enum Renderer
{
	RendererCPU,
	RendererD3D11,
	RendererD3D12,
};

// Set the renderer type
API_EXPORT void DLL_CALLCONV SetPanoramaRendererType(Renderer Type);

// Set the panorama image width and height you want to build
API_EXPORT void DLL_CALLCONV SetPanoramaWidthAndHeight(int Width, int Height);

// Set the input image width and height
API_EXPORT void DLL_CALLCONV SetInputImageWidthAndHeight(int Width, int Height);

// Set the input image projection parameters, all the input images are the same.
API_EXPORT void DLL_CALLCONV SetInputImageProjectionParameters(float Fovy, float NearClip, float FarClip);

// Set the count of the input images
API_EXPORT void DLL_CALLCONV SetInputImageCount(int ImageCount);

// Set the input image rotation by index.it's a quaternion, in x,y,z,w order.
API_EXPORT void DLL_CALLCONV SetInputImageRotation(int Index, float* InputImageQuaternionXYZW);

// Initialise the context and environment such as d3d11/d3d12 etc...
API_EXPORT bool DLL_CALLCONV Initialise();

// Set the input image data by index
// ImageData must be r8g8b8a8 format, the buffer length must be width * height * 4.
API_EXPORT void DLL_CALLCONV ApplyImageData(int Index, unsigned char* ImageData);

// Render one frame.
API_EXPORT void DLL_CALLCONV RenderOneFrame();

// Get the output panorama image data. the buffer length must be 4 * PanoramaWidth * PanoramaHeight
API_EXPORT void DLL_CALLCONV CopyPanoramaDataFromGPU(unsigned char* Buffer);

API_EXPORT void DLL_CALLCONV ReleaseInterface();
/*
usage:
int main()
{
	SetPanoramaRendererType();
	SetPanoramaWidthAndHeight();
	SetInputImageWidthAndHeight();
	SetInputImageProjectionParameters();
	SetInputImageCount();
	SetInputImageRotation();
	Initialise();

	ApplyImageData();
	RenderOneFrame();
	CopyPanoramaDataFromGPU();
	// repeat
	ApplyImageData();
	RenderOneFrame();
	CopyPanoramaDataFromGPU();
	.......

	ReleaseInterface();
	return 0;
}	

*/

In the most render engines, building a panorama image in the following step:

  1. build the camera cubemap image, which in six faces, each face is a quad, may be in the screen resolution of 1024 * 1024.
  2. sample the cube map image to panorama image. but in this way, the cubemap render must be in a render target, not screen capture. and in the most render engine like unreal 4, may be lost many post process volume effects.

My plugin's advantage:

  1. in my plugin, i can build panorama image in all kind of screen resolution, so you can capture screen to build the panorama, without lose any post process volume effects.
  2. can build large resolution panorama image like 8k, even though 16k and without any blurry.

any one who like this plugin, please contact me, not for free. in this folder, you can use the debug dll to do any test. my email address: [email protected]. price: sdk($299), source code($2999).

Any one who want to compile the application, please config the platform to debug + x86 mode.

The best renderer is d3d11. d3d12 need win10, and cpu using 4 threads to do the sample, it's slower than d3d11.

Some one may think the plugin run slowly, in fact ,it's very fast.the initialise may be a bit slow, it run once at the begining.

I don't do enough tests, any issues please contact me, thankyou!

panoramaplugin's People

Contributors

lygyue avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

fishchw

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.