Jump to content

when take A huge screen shot.


photo

Recommended Posts

i used engine.render.renderImage2D. when i take huge screen shot

 

each screenshot's projection changed.

 

It's not same what each image's scattering.

 

how to take same scattering(post Effect) image?

Link to comment

I am guessing that the player you are using to take the shot has got different zfar and znear settings to what you have in the editor.

Try setting these to match or alternatively use Unigine::getPlayer() from the core/scripts/utils.h file to get the player for the render function.

 

While we are on the topic of huge screenshots can somebody take me through the process of setting up the camera so I can stitch multiple renders together;

Link to comment

There is an article in Game Programming Gems 2 “Print resolution screenshots“  for tiled screenshot rendering.But maybe it is even more easy to adapt script code from new Unigine wall.h as this code already supports setting up multiple adjacent modelview-projection matrices

Link to comment

//....................................................................................................................................................................................................

// get_points

//....................................................................................................................................................................................................

void get_points(vec3 points[],mat4 iprojection)

{

points[0] = vec3(-1.0f,-1.0f,-1.0f);

points[1] = vec3( 1.0f,-1.0f,-1.0f);

points[2] = vec3(-1.0f, 1.0f,-1.0f);

points[3] = vec3( 1.0f, 1.0f,-1.0f);

points[4] = vec3(-1.0f,-1.0f, 1.0f);

points[5] = vec3( 1.0f,-1.0f, 1.0f);

points[6] = vec3(-1.0f, 1.0f, 1.0f);

points[7] = vec3( 1.0f, 1.0f, 1.0f);

 

forloop(int i = 0; 8)

{

vec4 p = iprojection * vec4(points);

points = vec3(p) / p.w;

}

}

//....................................................................................................................................................................................................

// transform_points

//....................................................................................................................................................................................................

void transform_points(vec3 dest[],vec3 src[])

{

forloop(int i = 0; 8)

{

dest = src;

}

}

//....................................................................................................................................................................................................

// Capture : Count = 1

//....................................................................................................................................................................................................

int Capture(string StrPath,string FileName,string ExtName,float fov,float Near,float Far,mat4 matMV,int Count)

{

if( Count < 1 )

return 0;

Image CaptureImage = new Image();

if( NULL == CaptureImage )

return 0;

//................................................................................................................................................................................................

//

//................................................................................................................................................................................................

int width = engine.app.getWidth();

int height = engine.app.getHeight();

float angle = 0.0f;

float aspect = ( float(engine.app.getWidth()) / engine.app.getHeight() );

//................................................................................................................................................................................................

// Capture Process

//................................................................................................................................................................................................

mat4 matPrj;

string FullPath;

if( 1 == Count )

{

matPrj = perspective(fov,1.0f,Near,Far);

engine.render.renderImage2D( matPrj , matMV, CaptureImage , width , height , "" , 0 );

FullPath = format( "%s\\%s.%s" , StrPath , FileName , ExtName );

if( 0 == CaptureImage.save( FullPath , 1.0f ) )

{

log.message( "Error Save Screen Shot : %s\n" , FullPath );

return 0;

}

log.message( "Save Screen Shot : %s\n" , FullPath );

}

else

{

mat4 projection = perspective(fov,1.0f,Near,Far);

mat4 modelview = matMV;

projection.m00 /= aspect;

vec3 points_0[8];

get_points(points_0,inverse(projection));

float fRangeX;

float fRangeY;

float fAddRangeX;

float fAddRangeY;

vec3 points_1[8];

vec3 points_2[8];

for( int x = 0 ; x < Count ; x++ )

{

for( int y = 0 ; y < Count ; y++ )

{

fRangeX = float( x ) / float( Count );

fRangeY = float( y ) / float( Count );

fAddRangeX = float( x + 1 ) / float( Count );

fAddRangeY = float( y + 1 ) / float( Count );

transform_points(points_1,points_0);

 

// far

points_2[2].x = lerp( points_1[2].x , points_1[3].x , fRangeX );

points_2[2].y = lerp( points_1[2].y , points_1[0].y , fRangeY );

points_2[2].z = lerp( points_1[2].z , points_1[3].z , fRangeX );

points_2[3].x = lerp( points_1[2].x , points_1[3].x , fAddRangeX );

points_2[3].y = lerp( points_1[2].y , points_1[0].y , fRangeY );

points_2[3].z = lerp( points_1[2].z , points_1[3].z , fAddRangeX );

points_2[0].x = lerp( points_1[0].x , points_1[1].x , fRangeX );

points_2[0].y = lerp( points_1[2].y , points_1[0].y , fAddRangeY );

points_2[0].z = lerp( points_1[0].z , points_1[1].z , fRangeX );

points_2[1].x = lerp( points_1[0].x , points_1[1].x , fAddRangeX );

points_2[1].y = lerp( points_1[2].y , points_1[0].y , fAddRangeY );

points_2[1].z = lerp( points_1[0].z , points_1[1].z , fAddRangeX );

 

// near

points_2[6].x = lerp( points_1[6].x , points_1[7].x , fRangeX );

points_2[6].y = lerp( points_1[6].y , points_1[4].y , fRangeY );

points_2[6].z = lerp( points_1[6].z , points_1[7].z , fRangeX );

points_2[7].x = lerp( points_1[6].x , points_1[7].x , fAddRangeX );

points_2[7].y = lerp( points_1[6].y , points_1[4].y , fRangeY );

points_2[7].z = lerp( points_1[6].z , points_1[7].z , fAddRangeX );

points_2[4].x = lerp( points_1[4].x , points_1[5].x , fRangeX );

points_2[4].y = lerp( points_1[6].y , points_1[4].y , fAddRangeY );

points_2[4].z = lerp( points_1[4].z , points_1[5].z , fRangeX );

points_2[5].x = lerp( points_1[4].x , points_1[5].x , fAddRangeX );

points_2[5].y = lerp( points_1[6].y , points_1[4].y , fAddRangeY );

points_2[5].z = lerp( points_1[4].z , points_1[5].z , fAddRangeX );

 

matPrj = frustum( points_2[0].x , points_2[1].x , points_2[0].y , points_2[2].y , -points_2[0].z , -points_2[4].z );

matPrj.m00 *= aspect;

engine.render.renderImage2D( matPrj , modelview , CaptureImage , width , height , "" , 0 );

FullPath = format( "%s\\%s_%d_%d.%s" , StrPath , FileName , x , y , ExtName );

if( 0 == CaptureImage.save( FullPath , 1.0f ) )

{

log.message( "Error Save Screen Shot : %s\n" , FullPath );

return 0;

}

log.message( "Save Screen Shot : %s\n" , FullPath );

}

}

}

//................................................................................................................................................................................................

delete CaptureImage;

CaptureImage = NULL;

//................................................................................................................................................................................................

return 1;

}

 

how to get current post effect?

 

or

 

how to get other huge screenshot image?

Link to comment

Scattering works in the screen-space (as well as volumetric shadows), hence there are slight differences when rendering into separate windows. But the question is, why not try and render a viewport into one huge window? If I am not mistaken here, modern video cards can support resolution up to 16000x16000.

Link to comment

Scattering works in the screen-space (as well as volumetric shadows), hence there are slight differences when rendering into separate windows. But the question is, why not try and render a viewport into one huge window? If I am not mistaken here, modern video cards can support resolution up to 16000x16000.

 

In theory yes. In practice (with unigine) there is an upper limit that is significantly lower than this that things stop rendering properly. It is based on the speed of the videocard, aa settings,amount of system memory and the complexity of the scene.

Link to comment

i want image size is 3m * 3m ( 300dpi ).

 

That Quality is poster.

 

i have calculated pixel.

 

Approximately pixel size = ( 1600 * 900 ) * 30

 

If you , how to resolve?

 

i want Capture image ( Applied post effect [ Scattering , volumetric shadows , etc ] ).

Link to comment

Rechecked it. Only volumetric shadows and HDR flares together with sun shafts would be different in different windows. Light scattering would look the same (sorry for misleading you). So if you disable these effects, you can stitch images together without any problems. If needed, shadows and flares can be drawn manually by an artists in some 2D editor afterwards. I'm afraid, it is the only workaround if you need screen shot this large.

Link to comment
×
×
  • Create New...