Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Yourself

Member Since 25 Feb 2008
Offline Last Active Today, 08:04 AM

#5198915 Copy texture between contexts

Posted by Yourself on 18 December 2014 - 03:24 AM

Assuming you want to use the passed-in resource with a different device/context (than it was created with), take a look at resource sharing.

You might need to create a new texture resource on the first device (so you can correct sharing flags) and share that texture with the second device. Now you can copy (using the first context) the rendered frame to the new resource (and use it with the second context/device).




#5198782 Determine Shader Model for Compiled Shader Object

Posted by Yourself on 17 December 2014 - 10:21 AM

You should use the provided macros (defined in d3d11shader.h):

D3D11_SHVER_GET_MAJOR(version)
D3D11_SHVER_GET_MINOR(version)

To get the shader type (returns a D3D11_SHADER_VERSION_TYPE):

D3D11_SHVER_GET_TYPE(version)

where version is the value of D3D11_SHADER_DESC::Version




#5176038 Sampling the Render target while rendering to it

Posted by Yourself on 25 August 2014 - 12:20 PM

I have done it in the past using an UAV and in-place (un)packing.

See this msdn article for more info




#5146167 Doubt with textures

Posted by Yourself on 10 April 2014 - 11:45 PM

Typically you would use submeshes. so a model (aka mesh), is actually an array of models ( frequently called submeshes).

a mesh is split into submeshes based on various strategies: artist defined, based on material/shader/texture/..., gameplay related reasons, ...

Do note that this (and pretty mutch any asset related operations), should be done offline.




#5145635 Deferred shading position reconstruction change

Posted by Yourself on 09 April 2014 - 06:01 AM

Thanks, I'll try it. smile.png

What does the rcp function actually do? Rounding, like floor / ceil in C?

 

rcp is the reciprocal ( 1 / x ).

note that in shaders this is often a fast approximation (so faster than actually doing 1.0 / x but less accurate).




#5126805 Increase texture reading speed

Posted by Yourself on 27 January 2014 - 03:40 PM

first off all, 144 tex lookups per pixel is a lot. a solution would be to simple use less ( find a balance between performance and visuals).

 

Try to make your textures smaller and/or slimmer.

fat textures (like your (R16G16B16A16) are slower so try to pack your data. 

Normals for example could be stored as X8Y8 and reconstruct Z inside the shader.

 

also look to the access patterns and filtering.

reduce filtering quality or try to use the Gather instruction if possible.

you could even refactor your renderer to make use of a compute shader where you can sample your textures into group-shared memory




#5126053 How to use VFACE in HLSL?

Posted by Yourself on 24 January 2014 - 03:05 AM

VFACE can be assigned to a parameter inside your shader function and the gpu will fill in the value on the fly.

something like this should work:

float4 PsMain( float vface : VFACE) : COLOR0
{
	if (vface < 0)
		return float4(1,0,0,1);
	else
		return float4(0,1,0,1);
}

do note that on D3D10 (and up), this value is now a boolean and renamed to SV_IsFrontFace.

float4 MainPS( bool vf :  SV_IsFrontFace)  : SV_Target
{ 
    float4 output;
	
	if (vf)
		output.x = 1;
	else 
		output.y = 1;
		
	return output;
}



#5117280 Graduation project ideas

Posted by Yourself on 16 December 2013 - 04:07 AM

I'm with Kaptein: You can investigate a lot of other techniques (imho temporal reprojection has the best results atm) but in the end you will find out that SSAA (supersampling) is by far the best.

 

some ideas you could do (although not sure you can do them with unity)

* Volumetric related stuff (like you mentioned can be lighting but also shadows and participating media like fog)

* dynamic global illumination

* voxel related techniques (GI, shadows, reflections, ... )

* screen space decals

* layered material system

* GPU particles (either as vfx or for example fluid dynamics)

* occlusion culling (software based, portals, .. )

* reflections (screen space, glossy reflections, ... )




#5111230 PIX Crash

Posted by Yourself on 22 November 2013 - 01:10 AM

I use Intel GPA

The frame analyser works pretty good and looks and feels simular to pix.




#5089155 Rawinput x64 bit problem

Posted by Yourself on 26 August 2013 - 06:37 AM

UInt nSize = 40;
BYTE m_Buffer[40];

The size difference between 32bit and 64bit.

use something like:

uint8 buffer[sizeof(RAWINPUT)] = {};
uint32 size = sizeof(RAWINPUT);



#5082014 Shader debugger in DX9

Posted by Yourself on 31 July 2013 - 02:21 PM

You can look at Nvidia Nsight or Intel GPA




#5076320 Texture Filtering and Direct3D9 vs Direct3D11

Posted by Yourself on 09 July 2013 - 04:57 AM

Texture filtering is used to improve texture quality. The better the filtering, the better the visuals (but at a performance cost). 

You should pick-up a graphics programming book in order to understand why you need filtering and what it is for.

 

The reason it looks wrong in your case is because you probably didn't add borders in your atlas.




#5066232 Mutex creation in multithreaded library

Posted by Yourself on 30 May 2013 - 03:01 PM

If you target windows,  you could use DllMain

for other platform there are alternatives (see this for example)




#5065742 Need help making wet/rain shader

Posted by Yourself on 29 May 2013 - 01:51 AM

Sébastien Lagarde is writing some fantastic articles about this on his blog




#5065167 Question about redundant texture binds.

Posted by Yourself on 27 May 2013 - 12:55 AM

Doing stage-management on the context does increase performance.

in my framework it was almost 15% when it profiled it a couple of months ago (pre-alpha build of the renderer though).






PARTNERS