Jump to content

  • Log In with Google      Sign In   
  • Create Account

newtechnology

Member Since 05 Nov 2013
Offline Last Active Yesterday, 01:35 PM

#5264140 Questions regarding how did you manage school

Posted by on 29 November 2015 - 01:03 PM

leaving school early and returning on your own terms later or never returning at all
[...]
being self-made and self taught which doesn't necessarily work in other countries as a viable life path

I'm not so sure about the self-taught part. As long as you can demonstrate proficiency (assuming the rest is at least "OK", that is you have at least a school certificate!), you should still be able to get hired, even if you're auto-didact. Surely not in the same salary class as someone with a university grade, but a no-suck job should certainly be attainable. Assuming your skills are what they need, and assuming you are comfortable in demonstrating that you have them.
About dropping out of school, you are most certainly right. "Dropped out of school" will absolutely not work, this is not a valid consideration.
Problem in places like India is you have 1.2 billion people of which a few thousand are extremely rich even compared to western standards, a million or two are extremely rich by Indian standards, and the remaining 1.99 billion are poor, no matter who you compared them against. A considerable part of these 1.99 billion leads a life which is not just "poor" but quite undesirable in every respect. Maybe you have seen one of these features on TV where 8-10 year old children defecate on a public place and more or less live off the garbage dump (which is on that public place, too). Poverty was kinda bad (but not so extreme) when I last visited India about 30 years ago, but their population has nearly doubled since then. So it's easy to tell that what you can see on TV is not much exaggerated.
Still, compared to the ones who have to work in the stone quarry, or compared to the ones who are abducted for organs, the kids living on the garbage dump have a pretty good life.
Everybody wants to get out of that, no surprise there.
So, unlike in other places (USA/Europe) where it's enough to be in the top-10% to get a reasonably well paid job, and in the top-5% to get a well-paid prestige job, you must be in the top-0.01% to succeed. That's simply because there's just so many more people trying to get out.
Unluckily, I can't tell a magic formula for landing in the top-0.01% (other than the obvious of being gifted, and working, working, working). I've only ever gone by "the good horse will not jump higher than it needs to", and that worked well. But I'm not in India...
Going to school at all (and finishing) even if you don't manage to be the best of the best is a good start in any case. Finishing at all more or less means being in the top-20% already, no matter how you do -- as long as you finish at all. And if you work hard, you will likely manage at least to get in the top-10%. Which means you are maybe not getting your dream job, but at least you don't have to work like an animal in a job that breaks you.

You mean remaining 0.99 billion :P


#5262775 No idea about this warning in VS2015

Posted by on 19 November 2015 - 02:13 PM

By upgrading to the latest SDK

I already have latest SDK. Just installed it today (Using WIndows SDK installer).




#5253169 Direct3D11 Multithreading

Posted by on 20 September 2015 - 06:38 AM

The device can be used by any thread. Feel free to load textures/models etc on any or all threads.

Contexts can only be used by one thread (at a time), but you can create as many (deferred) contexts as you need.

When you've finished submitting draw calls to a deferred context, you can call FinishCommandList to turn it into a ID3D11CommandList. You can then hand this over to your "main" thread (the one that owns the immediate context), and it can call ExecuteCommandList to send those commands to the GPU.

tl;dr-
Main thread owns "immediate context" and submits command lists.
Worker threads own "deferred contexts" and create command lists.
Every thread can use the device.

 

From what I know, you use threads to do work in parallel to load as many resources as possible at a time. But In std::threads, to make it work properly, I've to use thread.join() with mainthread for the mainthread to wait for that thread to finish the execution. Doesn't this completely destroy the purpose of threads? This is just like calling functions then.




#5244515 Including headers from Windows 10 SDK

Posted by on 04 August 2015 - 11:01 AM

Please clarify what "doesn't get included" means. Do you get an error? If so, what is the exact error message? 

#Include <d3d12.h> doesn't work (or IntelliSense doesn't detect that.)

@Dave:
Am I supposed to include path to Windows 10 SDK manually? I don't have to do this with Windows 8 SDK.




#5243621 How does each pixel in Shadow Map correspond to each pixel in scene?

Posted by on 30 July 2015 - 12:29 PM

How each pixel is supposed to correspond from Shadow map to Scene. For example, I've a sphere and I know it's nearest pixels from shadow map at it's edges. But what if in the scene, this pixels do not correspond to sphere or somewhere outside sphere? Can anyone please explain me shadow mapping and projective texture precisely (like Projection vertex onto light's projection window, then from NDC space to view space and then using that texCoords to sample shadow map, etc.)




#5243556 Frank D. Luna's DirectX 12 book available for Pre-order

Posted by on 30 July 2015 - 08:21 AM

Was browsing on amazon and just saw this:
http://www.amazon.com/Introduction-Programming-DirectX-Computer-Science/dp/1942270062/ref=pd_rhf_cr_s_cp_2?ie=UTF8&refRID=19HTHT2NGBF82NQCKYY7




#5238189 Static branching in shaders without effects11

Posted by on 03 July 2015 - 09:18 AM

 


But now I no longer use effects11. So how is this done now?

 

This has nothing to do with branching, really. One way to do this without the Effects-Framework is to use the option of specifying macros when compiling the shader

 

so something like this in shader:

if (true) { something(); } else { somethingelse(); } is optimized to
something();

right?

I was also asking how could I specify parameters of pixel shader like I used to do in effects11?




#5238181 Static branching in shaders without effects11

Posted by on 03 July 2015 - 08:53 AM

I read in Frank Luna's book that if parameters are uniform and we specify them in techniques and then the compiler resolves that and turns that into static branching so that dynamic branching at run-time could be avoided. Like this:

float4 PS(VertexOut pin, uniform int gLightCount, uniform bool gUseTexure) : SV_Target
{
// Interpolating normal can unnormalize it, so normalize it.
    pin.NormalW = normalize(pin.NormalW);
 
// The toEye vector is used in lighting.
float3 toEye = gEyePosW - pin.PosW;
 
// Cache the distance to the eye from this surface point.
float distToEye = length(toEye); 
...................
}
 

 
technique11 Light1
{
    pass P0
    {
        SetVertexShader( CompileShader( vs_4_0, VS() ) );
SetGeometryShader( NULL );
        SetPixelShader( CompileShader( ps_4_0, PS(1, false) ) );
    }
}
 
technique11 Light2
{
    pass P0
    {
        SetVertexShader( CompileShader( vs_4_0, VS() ) );
SetGeometryShader( NULL );
        SetPixelShader( CompileShader( ps_4_0, PS(2, false) ) );
    }
}
.....
 

But now I no longer use effects11. So how is this done now?




#5236568 Load Compiled Shaders

Posted by on 24 June 2015 - 09:11 AM

 

how do I get bytecode and bytelength? If from the compiled shader, then which shader? Pixel shader or vertex shader?

 
 

using the vertex shader bytecode and code length you use to create the vertex shader.


 
I'm not sure how to be more exact than that. You have to read the entire post, not just the code snippets.
 
 

HRESULT hr = g_pd3dDevice->CreateVertexShader(bytes, fileSize, nullptr, MyVS.ReleaseAndGetAddressOf());

 

EDIT: A little explanation may help. The "input signature" is the format of the data that the input assembler needs to know about to send input data from the CPU to the vertex shader. After that, the pipeline takes care of "transferring" the vertex output data to the next stage. As a result, only the input format required by the vertex shader stage needs to known. The process of creating the input layout using the vertex shader bytecode is to check that the input elements you describe in the D3D11_INPUT_ELEMENT_DESC array match the expected input requirements of the vertex shader.

 

Didn't notice it :P
Thanks for that explanation.




#5236171 Load Compiled Shaders

Posted by on 22 June 2015 - 10:16 AM

You can simply write your shader code as a .fx file, and place it within your visual studio 2012 (or greater) project.

 

Set the type to 'shader', in the properties, and set the type of shader (vertex, pixel, etc) and the version (i tend to use vs_4_1 or newer).

 

Visual studio will then compile the .fx to .cso as part of the compilation. You can then load the .cso files directly via the ID3D11Device::CreatePixelShader(), CreateVertexShader() etc methods without a compilation step in your own code. For example in my own game:

std::pair<const char*, UINT32> Shader::LoadShaderImpl(const std::wstring &filename)
{
    UINT32 ShaderLen = 0;
    const char* ShaderData = Util::ReadWholeFile(filename, ShaderLen, true);
    return std::make_pair(ShaderData, ShaderLen);
}
 
PixelShader::PixelShader(ID3D11Device* device, ID3D11DeviceContext* context, const std::wstring &filename) : Shader(device, context)
{
    std::pair<const char*, UINT32> data = LoadShaderImpl(filename);
    HRESULT hr = (data.first == nullptr ? ERROR_FILE_NOT_FOUND : device->CreatePixelShader(data.first, data.second, 0, &ps));
    if (FAILED(hr))
        throw std::runtime_error(Util::WStringToAscii(Window::GetString(GetModuleHandle(nullptr), IDS_ERROR_LOADING_SHADER)));
    else
        Util::SetDebugName(ps, Util::WStringToAscii(filename));
}

You can set your shader as active in the current pipeline by calling the PSSetShader() method on your context:

void PixelShader::Set()
{
    context->PSSetShader(ps, 0, 0);
}

When a shader is set, any constant buffers it uses are expected to be set up before it is called implicitly by rendering:

    ID3D11Buffer* raw[1];
    raw[0] = ((Buffer*)buffer)->Get();
    context->PSSetConstantBuffers(0, 1, raw);

You don't need the "technique" section in your .fx file that ties together multiple shaders etc into an effect as using the shaders directly with PSSetShader() etc won't use it (in fact, to the best of my knowledge, it's best to avoid it, but im sure someone else might correct me on this).

 

Let me know if this helps smile.png

I've successfully compiled shaders but I still don't get how do you load it into memory. I know you use Device->CreateVertexShader and CreatePixelShader but before that I don't know how to load shader into memory.




#5235072 Load Compiled Shaders

Posted by on 16 June 2015 - 03:54 AM

You can simply write your shader code as a .fx file, and place it within your visual studio 2012 (or greater) project.

 

Set the type to 'shader', in the properties, and set the type of shader (vertex, pixel, etc) and the version (i tend to use vs_4_1 or newer).

 

Visual studio will then compile the .fx to .cso as part of the compilation. You can then load the .cso files directly via the ID3D11Device::CreatePixelShader(), CreateVertexShader() etc methods without a compilation step in your own code. For example in my own game:

std::pair<const char*, UINT32> Shader::LoadShaderImpl(const std::wstring &filename)
{
    UINT32 ShaderLen = 0;
    const char* ShaderData = Util::ReadWholeFile(filename, ShaderLen, true);
    return std::make_pair(ShaderData, ShaderLen);
}
 
PixelShader::PixelShader(ID3D11Device* device, ID3D11DeviceContext* context, const std::wstring &filename) : Shader(device, context)
{
    std::pair<const char*, UINT32> data = LoadShaderImpl(filename);
    HRESULT hr = (data.first == nullptr ? ERROR_FILE_NOT_FOUND : device->CreatePixelShader(data.first, data.second, 0, &ps));
    if (FAILED(hr))
        throw std::runtime_error(Util::WStringToAscii(Window::GetString(GetModuleHandle(nullptr), IDS_ERROR_LOADING_SHADER)));
    else
        Util::SetDebugName(ps, Util::WStringToAscii(filename));
}

You can set your shader as active in the current pipeline by calling the PSSetShader() method on your context:

void PixelShader::Set()
{
    context->PSSetShader(ps, 0, 0);
}

When a shader is set, any constant buffers it uses are expected to be set up before it is called implicitly by rendering:

    ID3D11Buffer* raw[1];
    raw[0] = ((Buffer*)buffer)->Get();
    context->PSSetConstantBuffers(0, 1, raw);

You don't need the "technique" section in your .fx file that ties together multiple shaders etc into an effect as using the shaders directly with PSSetShader() etc won't use it (in fact, to the best of my knowledge, it's best to avoid it, but im sure someone else might correct me on this).

 

Let me know if this helps smile.png

 

Thanks!
I would try and ask again if I get any problems.




#5235062 Load Compiled Shaders

Posted by on 16 June 2015 - 03:25 AM

Before I used to use Effects11 for loading compiled shaders. Now since I've decided not to use Effects11 anymore, I want to know how the other way works around. How shaders are coded without effects11? How are they loaded without effects11? 
I do not want to compile shaders at run-time. I just want to load compiled shaders. Any help?




#5232981 I am beginning to hate the IT and gaming industry.

Posted by on 05 June 2015 - 11:57 AM

its already a lot of money per month if you live in India. Avg. income of an Avg. person in India is $1000 per month.

Lucky you.  That makes it even easier for you to launch your products online!  
 
While people in most Western nations could not subsist on that, you can get with your friends, release what would be a commercial failure in other rich nations, and have it support you.
I am still making $2 per month using AdSense with 2 android games. I have a dream game project but I don't have resources (artists, other guys and budget) and somewhat high quality skills necesarry.


#5232816 I am beginning to hate the IT and gaming industry.

Posted by on 04 June 2015 - 01:21 PM

Okay, 17 interviews later, finally got a new job.  It pays rather well for a position that doesn't require immediate coding ($70k). 
 
I guess I just had a Vegeta moment for a while there.
 
Shogun.

Someone like me would happily take $10/hour job because its already a lot of money per month if you live in India. Avg. income of an Avg. person in India is $1000 per month.


#5230882 OpenGL vs DirectX

Posted by on 25 May 2015 - 01:37 PM

Unity.




PARTNERS