Jump to content

  • Log In with Google      Sign In   
  • Create Account

pulo

Member Since 23 Jun 2012
Offline Last Active Apr 21 2016 11:35 AM

#5284344 Isometric art projected on 3D shapes

Posted by pulo on 30 March 2016 - 03:47 PM

Hi there,

 

so i am currently investigating a lot of different methods for rendering beautiful isometric environments while still leaving room for dynamic elements (lights etc.). I think leveraging the 3D depth testing is a good idea.

 

I stumbled across this blog post for Shadowrun Returns and their method of doing it appeals to me:

http://harebrained-schemes.com/blog/2013/03/22/mikes-dev-diary-art/

 

How did they do it? I mean it says that they are projecting their art onto simple 3D shapes, but for example do they use multiple same sized cubes for the bigger buildings, or actually a single larger one? I just cannot wrap my head around this problem...

I hope someone can clear up my confusion regarding how to build a isometric world out of 3d shapes and thus being able to leverage the depth testing of the 3d hardware.

 

Thanks!




#5282600 Iso-/Dimetric tile texture has jagged edges

Posted by pulo on 22 March 2016 - 05:38 AM

I had a similiar issue once, and it turned out I was doing windowed mode wrong in terms of calculating the window size to fit the backbuffer size etc., resulting in a vaguely stretched display that was hard to notice for a long while.. Maybe you could check your window+DirectX initialisation code?

 

 


I was going to say the same thing. You want to make sure that the client area of your window is the same size as your D3D backbuffer,
otherwise you'll get really crappy scaling when the backbuffer is blit onto the window. You can use something like this:
 
RECT windowRect;
SetRect(&windowRect, 0, 0, backBufferWidth, backBufferHeight);

BOOL isMenu = (GetMenu(hwnd) != nullptr);
if(AdjustWindowRectEx(&windowRect, style, isMenu, exStyle) == 0)
    DoErrorHandling();

if(SetWindowPos(hwnd, HWND_NOTOPMOST, 0, 0, windowRect.right - windowRect.left, windowRect.bottom - windowRect.top, SWP_NOMOVE) == 0)
    DoErrorHandling();
See the docs for AdjustWindowRectEx for more details.

 

 

Thank you! Both of you! That was indeed my problem. I was so focused on checking the pipeline that i totally forgot about the window/directx initialization.

EDIT: If any of you two also want to answer the question on stackoverflow, feel free to do so. I will wait till tomorrow and just accept the first answer that comes. Otherwise i will just answer the question myself and link to this thread.




#5162112 Dynamic Shader Linkage and ShaderReflection

Posted by pulo on 22 June 2014 - 09:22 AM

Well i found something which might help. If i use the GetInterfaceByIndex on the Shader Reflection type i get the expected class "D3D_SVC_INTERFACE_CLASS" which i suspect would be different or non-existent on a normal struct.

 

EDIT: The only thing now left for me is to find out if it is possible to get the name from here through shader reflection. Any Ideas?:

iBaseLight     g_abstractAmbientLighting;
               ^^^^^^^^^^^^^^^^^^^^^^^^

struct PixelInput
{
float4 position : SV_POSITION;
float3 normals : NORMAL;
float2 tex: TEXCOORD0;
};



#5162105 Dynamic Shader Linkage and ShaderReflection

Posted by pulo on 22 June 2014 - 08:47 AM

Yes the constant buffer stays the same, regardless of which class implementation i am using at runtime. (Was this what you were asking?)

The abstract interface is used like this:

iBaseLight     g_abstractAmbientLighting;


struct PixelInput
{
float4 position : SV_POSITION;
float3 normals : NORMAL;
float2 tex: TEXCOORD0;
};


float4 main(PixelInput input) : SV_TARGET
{
float3 Ambient = (float3)0.0f;
Ambient = g_txDiffuse.Sample(g_samplerLin, input.tex) * g_abstractAmbientLighting.IlluminateAmbient(input.normals);


return float4(saturate(Ambient), 1.0f);
}

The reason i would like to reliably differentiate between a normal struct and a class used for dynamic shader linkage is that i would later use the variable name to automatically get the class instances like this: 

 g_pPSClassLinkage->GetClassInstance( varDesc.Name, 0, &g_pAmbientLightClass );



#5161031 Texure mapping goes wrong. Why?

Posted by pulo on 17 June 2014 - 06:39 AM

Alright. I found the problem:

 

I had to invert the "v" coordinate of the texture coordinates (v = 1-v).

Is there a way to detect if my texture coordinate need inversion or do need to specify this before conversion (or alternatively export my mesh for a left handed coordinate system)?

 

Thanks for any suggestion!




PARTNERS