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!

SIC Games

Member Since 22 Jun 2012
Offline Last Active May 13 2015 08:26 AM

#5228174 D2DFontX 1.0 Released Today!

Posted by SIC Games on 09 May 2015 - 02:11 PM

New functions help to translate, scale, rotate, skew and to set the the world matrix.

//-- Global Declaration.
D2DFontX *fontX;

bool InitFontX(IDXGISwapChain *d3d11swapchain, HWND windowhandle) {
     FontSettings fontSettings = FontSettings(L"Impact",16.0f, FONTCOLOR(1,1,1,1), DWRITE_FONT_WEIGHT::DWRITE_FONT_WEIGHT_NORMAL, 
     fontX = new D2DFontX(d3d11swapchain, fontSettings, windowhandle);
     if(fontX) {

       D2D1::Matrix3x2F myWorld;
       myWorld = fontX->getTranslationMatrix();
        return true;
return false;

void renderFontX(std::wstring text) {
if(fontX) {

#5228151 D2DFontX 1.0 Released Today!

Posted by SIC Games on 09 May 2015 - 12:51 PM

D2DFontX is a very simple D2D1 wrapper for D3D11. Include and Library files must point to Windows SDK and NOT DirectX SDK. It's in a debug release but you can help it become in Release State by pointing out what can be better. Any questions just ask.


If you don't have GitHub then you would have to download it. Then head over to the repository and download it from there.




Please read the ReadMe.txt first it should point you in the right direction.


#5227803 Issue with D2D10.1 blending with D3D11 Render Target

Posted by SIC Games on 07 May 2015 - 10:45 AM

Well high five to IeDoc! I got the D2D1 interoped from the samples you provided with ease. Just had to make sure I released some of the objects. D2D1 Debug Information was giving me memory leaks warning.


So this is cool and awesome because less code and easy to intergrate! Finally Microsoft done something cool. :D

#5210198 Has anyone had this problem when loading mesh with ASSIMP or anything?

Posted by SIC Games on 11 February 2015 - 11:16 PM

I'll do that BuckEye! Thanks for responding and I'll keep an update on how things went in the morning.

#5179974 Light - Dot function

Posted by SIC Games on 12 September 2014 - 03:18 PM

Thanks, float4 PosD = float4(0, 1, 0, 0); resolved problem with dot funtion.

But i still have problem with this lightning.

struct PS_INS_INPUT{

	float4 Pos : SV_POSITION;
	float4 Nor : NORMAL;
	float2 Tex : TEXCOORD0;
	float Light_S : LIGHT_S;


struct VS_INS_INPUT{

	float4 Pos : POSITION;
	float4 Nor : NORMAL;
	float2 Tex : TEXCOORD0;

	matrix instancePos : INSTANCEPOS;
	float Light_S : LIGHT_S;


	output.Pos = mul (input.Pos, input.instancePos);
    output.Pos = mul (output.Pos, View);
    output.Pos = mul (output.Pos, Projection);
    output.Tex = input.Tex;
	output.Light_S = input.Light_S;
	output.Nor = mul (input.Nor, input.instancePos);

    return output;

float4 PS_INS (PS_INS_INPUT input) : SV_Target{

	float4 diffuse = txDiffuse.Sample( samLinear, input.Tex ) * input.Light_S + KolorL;

	float3 PosD = float3 (0.25f, 0.5f, -1.0f);

	float3 LighD = float3 (0.5f, 0.5f, 0.5f);
	float3 LighA = float3 (0.2f, 0.2f, 0.2f);
	float3 FK;

	float3 NR = float3 (input.Nor.x, input.Nor.y, input.Nor.z);

	FK = diffuse * LighA;
	FK += saturate(dot(PosD, NR) * LighD * diffuse);

	return float4 (FK, diffuse.a);


Without FK += saturate(dot(PosD, NR) * LighD * diffuse);



With FK += saturate(dot(PosD, NR) * LighD * diffuse);



Why do I get someting like second photo? 


I'm guessing this is directional lighting being used like the sun? The reason why you're getting washed out area inside image two would because the position of the light is 1 unit above ground.

float3 PosD = float3(0.25f, 0.5f, -1.0f); //-- Light Position
float3 lightD = float3(0.5f, 0.5f, 0.5f) //-- Light Diffuse term
float3 lightA = float3(0.2f, 0.2f, 0.2f); //-- Light Ambient
float3 diffuseLight = diffuse.xyz * lightA; //-- Calculating diffuse map with the ambient color.
float intensity = saturate(dot(posD, input.normal)); //-- Clamp from 0 to 1 and get angle of light position to normal.
diffuseLight += saturate(lightD * intensity); //- Accumulate the diffuse light with the light intensity.

You could probably leave out the saturate from the diffuseLight accumulation - if it helps. I see you also changed the light position as well. Try to position it a bit heigher on Y Axis and see if there's any changes on how you like it.


Also the dot hlsl function returns a scalar 1 (float, int) - which could be the reason why you were having issues.



#5178234 Shader Resource View and Load()

Posted by SIC Games on 04 September 2014 - 11:20 PM

tex2D.MipLevels = 1;
tex2D.ArraySize = 1;
tex2D.Height = (height size of your texture.)
tex2D.Width = (width)
tex2D.Usage = D3D10_USAGE_DEFAULT;
tex2D.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
tex2D.CPUAccess = 0;
tex2D.SampleDesc.Count = 1;
tex2D.SampleDesc.Quality = 0;
tex2D.MiscFlags = 0;

srvD.Texture2D.MipLevels = 1;
srvD.Texture2D.MostDetailedMip = 0;
srvD.Format = tex2D.format;

I should've asked if you're trying to load a texture? If so then  you can use the D3DX10CreateShaderResourceViewFromFile


MSDN Reference of the function D3DX10CreateShaderResourceViewFromFile




It would load the texture and create a shader resource view which you can place inside your shader code.


Unless you're trying to do something different.

#5177598 What are these showing in my normal map (Forward Rendering)

Posted by SIC Games on 02 September 2014 - 12:37 AM

I've solved the issue - in BrazynerSoft Normalmapping tutorial he has it where you can compute the normals and tangents if needed to.


What I didn't notice is inside where the vertex data gets stored there's a XMFLOAT3 Tangent. If the compute normals aren't enabled - it sets the Tangent Data to black. Still resulting in proper display of the normal map without the messed up with edges that I had first post.


So, now there's no longer a weird shading issue due to proper filling of the input layout for the shader and the the vertex data.  It's really funny how the input layout for the shader has to match the exact same type of vertex data going in.


Thanks again for the support!

#5177566 What are these showing in my normal map (Forward Rendering)

Posted by SIC Games on 01 September 2014 - 09:28 PM

I hit the jack pot - I rendered Tangent data out Brayzsoft tutorial Normal Mapping and compared to mine plane.


Mine inside editor:




Brayznsoft Normal Map tutorial - Tangent Data rendered out


Brayzsoft-Normalmapsample (0-00-10-19).jpg


Now the question is since I set the compute normals off inside Brayzansoft normal map example - I have to look deeper into why my tangents aren't working.


Thanks Hodges for giving a helping hand but I know which direction now I have to head. Focus on how the data's being loaded from the mesh and also see if I can place visual cues in the geometry shader of the normals directions too.


Thanks Hodge..



#5177554 What are these showing in my normal map (Forward Rendering)

Posted by SIC Games on 01 September 2014 - 07:39 PM

This is the tangent rendered out without using color


Snapshot1 - Copy (3).jpg


The black and the abruptness of colors I would suspect to be a issue in the tangents. So possibly I would have to re-calculate the tangents by using the normals inside the mesh.


This is the tangent data calculated.




The same edges appear as top of this thread. So possibly recacluating the tangent data would do some good.



#5177548 What are these showing in my normal map (Forward Rendering)

Posted by SIC Games on 01 September 2014 - 07:24 PM

By discontinuuity what do you mean? Non-consistant?


This is the image of the normal as a color:


The hard edge is considered a discontinuity?


Normal map



input.normal as color

Snapshot1 - Copy (2).jpg


input.tangent as color


Snapshot1 - Copy.jpg


I'm sorry for uploading so many photos just trying to understand what you mean by discontinuity and how to debug something later in the future.



#5177543 What are these showing in my normal map (Forward Rendering)

Posted by SIC Games on 01 September 2014 - 06:56 PM

What I got was this :



Top view:




Left View



Bottom View



What colors am I looking for exactly?


I changed the PS code to be like you mentioned:

        input.normal = normalize(input.normal) * 0.5f + 0.5f;
	input.tangent = normalize(input.normal) * 0.5f + 0.5f;
	//input.tangent = normalize(input.tangent - dot(input.tangent, input.normal) * input.normal);

	float3 B = cross(input.normal,input.tangent);
	float3x3 texspace = float3x3(input.tangent,B,input.normal);
         input.normal = mul(normalmap,texspace);

#5177533 What are these showing in my normal map (Forward Rendering)

Posted by SIC Games on 01 September 2014 - 05:36 PM

When I output the normal map this shows up:




Would this be a normal issue inside the mesh? Funny how Brazynsoft checks to see if the parameter of cumpute normals is true or false. If not then it uses the normals from the mesh. I'm using the normals from the mesh.


The shader:

output.normal = mul(input.normal, (float3x3)worldMatrix); //-- worldMatrix is the model's world matrix.
output.tangent = mul(input.tangent, (float3x3)worldMatrix);


float3 normalmap = Textures[1].Sample(ss, input.texcoord);
normalmap = 2.0f * normalmap - 1.0f;

input.normal  = normalize(input.normal);
input.tangent = normalize(input.tangent - dot(input.tangent, input.normal) * input.normal);
float3 biTangent  = cross(input.tangent, input.normal);
float3x3 texSpace = float3x3(biTangent, input.Tangent, input.normal);

input.normal = normalize(mul(normalmap, texSpace));

Or possibly this could be a result of the normal map its self.

#5176601 Why are their bumps in my shadow mapping?

Posted by SIC Games on 28 August 2014 - 12:33 AM

I just started implemending Shadow Mapping in my engine and I see inside the editor there's bumps inside the shadow map. I'm wondering what they are?


The current set up I have is an orthographic Left Handed view for rendering depth. The depth stencil is rendered as DXGI_FORMAT_D24_UNORM_S8_UINT and is bounded both as depth stencil and shader resource. The texture format for the depth stencil is DXGI_FORMAT_R24G8_TYPELESS The shader resource view is formated as DXGI_FORMAT_R24_UNORM_X8_TYPELESS.


Is it a format issue?




If anyone needs to see sniplets of code I'll share.

#5176078 What you think of my Depth Pass AA?

Posted by SIC Games on 25 August 2014 - 04:00 PM

I'm wanting to implemend Nvidia's FXAA and TXAA inside my game - however, I figure I create my own AA. Perhaps, someone already has already came up with the type of AA and there's more work to do to enhance the blurring. I want your feedback and let me know what you think. It's rough demonstration not perfect quite yet.


The firest picture is when it's just using the 8x MSAA on high setting possible. The second image is the 8x MSAA and my Depth Pass AA implematation.


I'm still working on how to make it better. Was just fascinated on the descripton in Nvidia's website how FXAA works - this is when I started to think about trying out my own. I have a simple blur but I am thinking about making it box blur with two passes or possibly gaussian blur.

Attached Thumbnails

  • DepthPassAA-Off.PNG
  • DepthPassAA-On.PNG

#5173363 What happened to Rastertek?

Posted by SIC Games on 13 August 2014 - 09:49 AM

I need to always expand my skills so I may be converting rastertek tutorials everything into DirectX11.1 and openGL. When fully finished I'll send the link to anyone who will needed the tutorials. Sounds cool?