Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 26 Mar 2013
Offline Last Active Aug 14 2015 08:59 PM

#5238298 What is the easiest way to show effects(ice, fire, thunder, etc...) in direct...

Posted by markypooch on 03 July 2015 - 09:06 PM

It sounds as though you are using a method similar to that of one of the rastertek tutorials for fire. Having implmented it myself it produced an amicable result for a minimal amount of coding/effort.

However, you could try volumetric rendering with spherical billboards. The groundwork for the effect is layed out in ShaderX5, though im sure there is other relevant information to it in other publications.




#5233883 HLSL matrix initialization

Posted by markypooch on 09 June 2015 - 01:42 PM

Might be time for someone with more HLSL knowledge to step in but I think it pertains to how HLSL stores data internally. It stuffs everything into a four-component vector, if anything straddles the 16-byte boundary it is liable to be pushed into a adajcent vector in memory or truncated.



#5233864 HLSL matrix initialization

Posted by markypooch on 09 June 2015 - 12:47 PM

Hmmm, while I may be false in this assumption it looks like your values are indeed being read column major. I think by default HLSL is column-major. Compare/Contrast the values of your matrice to the debugger values (column wise) and you'll see whats going on. Each 4th component is being truncated (read column wise).  


Try using a float4x4 type for your tbn matrix and see if that works



#5233585 The most efficient way to create a const array in HLSL?

Posted by markypooch on 08 June 2015 - 12:43 PM


Put the static keyword in front. In this case, it should only be defined once right?


From my understanding it's the same as in c/c++. Its defined once, and maintains static duration during run-time.



There are const global variables in OpenGL is there such an alternative in D3D?

The equivalent to my knowledge is a ConstantBuffer in D3D (ShaderModel 4.0+). Even if your data is to be declared outside of a constant buffer it still gets tucked into a default constant buffer under the hood.


To clarify a ConstantBuffer is a buffer that is optimized for constant variable usage and enables the app developer to specify data that is constant for that pass through the shader. Those are your constant variables in HLSL.


As to your original question, I don't know if it's the best way to do it (I can't say one way over the other), I don't think the way your doing it now is very performance prohibitive. At most when the function is called it has to allocate 128 bytes in video memory for that array.



#5232995 Engine design, global interfaces

Posted by markypooch on 05 June 2015 - 01:03 PM

I think Josh articulated the big elephant in the room wonderfully. Singletons, and globals for that matter hide dependacies, couple code, and pave the way for poor design to go unnoticed.


However, I'm sure just like any tool, it has a purpose. But like a chainsaw it can be (and usually is) horribly misused.



#5226887 Dissidia

Posted by markypooch on 02 May 2015 - 05:22 PM


What is there to consider when First building a game as such? The stat? the goal? The features? 3d space maneuver?


These are mostly things you would have to guage on your own end. A tiny amount of programming exp.erience is an ambigous statement


The goals ideally are realistic, and are usually directly proportionally to the amount of time you and your team have to invest into the project. Does your team have financial backing for this project, do they have a job, or children? It might sound like a rather unrelated inquire but these things usually have a direct relation to the progression of the project and the projected goals you initally set.



Is it a necessity to create a new physics engine? 
If so, how should i start?


Not nesecarily, you could use a pre-made physics engine and depending on the time-frame you set for the project to be completed, might be a bit more advantegous to prevent scope creep. (Bullet-Engine, Havox are a few pre-made ones)



I hope this doesn't sound, or is actually not too ambitious


It sounds very ambitious, especially if your still learning how to code. But then again nothings impossible. Just remember even the more mundane 3D effects have a lot going on under the hood to produce the final result. The diffculity to reproduce thse effects are usually going to be exemplified exponentially by the less experince you have in programming and 3D application development.



#5194254 MAKE A CHOICE engines

Posted by markypooch on 23 November 2014 - 06:19 AM

I'll assume you have some programming background since your probing around for engines.



i need wich one that can render millions voxel-like objects with out any problems.


That's subjective and ultimately depends on the system that will be executing the build and the overall complexity of the App.


Several factors also weigh into your previous request


-lighting (will your minecraft clone have lighting? If so it adds another layer of calculations for each cube or mesh. (I think, could be mistaken though; MC utilized lightmaps as opposed to the per-vertex lighting available in Fixed Function GL))


-Run-time world-gen (will your world dynamically be generated as the program runs as mineCraft is?)


-Networking (I would say this is a must if you looking to make MineCraft clone)


And that's the VERY tip of the ice-berg. All of these things MineCraft has (In some form or another). Pinpoint your needs and your projected end-goal, and try choosing an egine based upon that



#5189464 "Click to start the game"

Posted by markypooch on 27 October 2014 - 12:56 PM

Depends on the game and if the player is going to be thrown into the action right away.


A game I made for Android for fun was a 3D-Pacman clone in which starting the player off in the level right after he died and lost a life, or just completed a level was a bit bombastic and ultimately jarring to the end-users ultimate experience. This issue I feel was dealt with by just swiping up on the screen, as noted by the picture below



#5189191 Need some help, can't figure out what's wrong

Posted by markypooch on 26 October 2014 - 03:08 AM

I Ran into a similar issue with the XNA Math Library. I believe the exception is being thrown from the transpose method. Basically, and this is a bit of an assumption on my part, but your passing mis-aligned data that will ultimately straddle the underlying SIMD registers.


Whats already been touched upon is true (Objects Dynamically allocated on the heap are 8-byte aligned and XNA math and apparently DirectXMath require 16-byte alignment)


A solution I came upon is more or less what BuckEye has already touched upon but a bit more drastic, and I would imagine if not used properly; dangerous. By overloading the new operator.


template<size_t Alignment> class AlignedAllocationPolicy



    static void* operator new(size_t size)


        return _aligned_malloc(size,Alignment);


    static void operator delete(void* memory)







the New and Delete operator are both overloaded. Obviously if you allocate a block of memory with a certain byte offset, you want to deallocate by that same byte offset

You could store this above template code in a .h file if you please. Then to utilize it, you do something akin to,


class A : public AlignedAllocationPolicy<16> //where you pass the byte offset as an argument


Now, personally this has always seemed hackish to me. But, it works with the XNA Library. Also make sure your Vector and Matrice types are members of this child class.


P.s. The reason why I THINK 16-Byte alignment is needed is because XNA and once again DirectXMath (I have not used the later) utilize the SIMD registers on the cpu for general efficiency for 32-bit ops. So passing data that is not 16-bit aligned will straddle the registers. Kinda similar to packing Constant Buffers for Shaders.  (Correct me if the previous paragraph was misinformed)



#5189130 How Can I Make This Scene Look Better

Posted by markypooch on 25 October 2014 - 04:38 PM

Hello all,


I have been working on a hallway scene for a game that's premise is yet to be decided.


To start this off I'm no artist. I am however relatively versed at this point in 3D modeling however, more in context have become quite familiar with blender.


While I won't say personally the scene looks bad I will say it looks VERY cookie cutter.

And I am more or less wondering what the 3D guru's around here would do to add more of a fidelity flare to their scenes.


-Bloom? Is that applicable to indoor scenes?

-Some kind of Film-grain post-processing? (the kind of effect that seems to be used throughout all of Alien Isolation)

-Shadows of course (After FEAR 1 I am a HUGE advocate of Hard-Shadows :) )


But maybe I'm missing something. Let me know what you think of this scene and what techniques you would utilize to improve/stylize it.


I am using D3D11/C++








#5157343 Tweening Questions

Posted by markypooch on 01 June 2014 - 08:54 AM

Just a status update, thought you guys might like to know.


Though I haven't implmented Skinning yet, I did tweening to work after I implemented a hardware

version (did my tweening in HLSL) So I must have been doing something silly with the dynamic buffers.


Kinda off topic but the results aren't bad. (I still plan on doing skinning)



#5156060 Tweening Questions

Posted by markypooch on 26 May 2014 - 12:29 PM

Hello all!


I started to look into tweening since it looked like a fun and sort of quick way to get some basic animations going on my meshes.


Well, due to the sake of simplicity I decided to implement it on the CPU side first with dynamic buffers. While performance is pitifull, thats to be expected when pushing data back and forth from the CPU to the GPU.


However, I've run into a issue that makes me ask


The OBJ format. I've heard that the blender exporter (correct me if im wrong) will rearrange the vertices from export to export. thus negating any tweening attempts. Since I most comfortable with the OBJ format is there a way around it (I see in the mesh export options in blender, keep vertex order) or is this just wishful thinking. If you think OBJ is a no go. What format do you recommend?


Also, my implementation is based on Advanced Animation with DirectX, i just stuffed all the values into XNA types.

I'm including my tweening implementation just in case I missed something silly that someone could hint to. (And also as a validation that this isn't completely off XD) And also because my meshes when tweening wig out and start rendering crazy polygonal shapes and colors! Also as if I'm referencing out-of bounds garbage memory and passing it to D3D

float time = 0.0f;
float length = 5.0f;
if (isMoving)
        Time += 5.0f * dt;
        if (Time > 5.0f) Time = 0.0f;
//Note: vertices[x].at(x) represents a vector of pointers which hold all the info of each subset of the overall mesh

scalar = Time / length;

                for (int i = 0; i < mCount; i++) //mCount = subsetMeshCount
                    for (int j = 0; j < verticeCount[i]; j++)
                        //Interpolate Positions
                        XMVECTOR vecSource = XMLoadFloat3(&vertices[i].at(j).pos);
                        float value = (1.0f - scalar);
                        vecSource *= value;

                        XMVECTOR vecTarget = XMLoadFloat3(&vertices2[i].at(j).pos);
                        vecTarget *= scalar;

                        XMStoreFloat3(&verticesResult.at(j).pos, (vecSource + vecTarget));

                        //Iterpolate Normals
                        XMVECTOR vecSourceNorm = XMLoadFloat3(&vertices[i].at(j).norm);
                        value = (1.0f - scalar);
                        vecSourceNorm *= value;

                        XMVECTOR vecTargetNorm = XMLoadFloat3(&vertices2[i].at(j).norm);
                        vecTargetNorm *= scalar;
                        XMStoreFloat3(&verticesResult.at(j).norm, (vecSourceNorm + vecTargetNorm));

                        verticesResult.at(j).norm               = vertices[i].at(j).norm;

                        //Pass along Materials
                        verticesResult.at(j).color                = vertices[i].at(j).color;

                    //Lock the dynamic buffer (block the GPU)
                    bro->devcon->Map(vertexBuffer[i], NULL, D3D11_MAP_WRITE_DISCARD, NULL, &ms);

                    //Grab a pointer to the data, pass along update vertice info, and remap the buffer
                    VertexM *v = reinterpret_cast<VertexM*>(ms.pData);
                    *v          = verticesResult[0];
                    bro->devcon->Unmap(vertexBuffer[i], NULL);

Any replies are appreciated smile.png



#5146773 How does the screenshots look?

Posted by markypooch on 13 April 2014 - 04:06 PM

Hello all,


I would just like to thank everyone at this website and on the forums for helping me grow as a graphics programmer. It's been a long time coming, but now I think I want to post a picture and get some feedback regarding the scene.


Some things I will note


     The shadows are a little bit off (Still working on 'em)

     The HUD can use improvement (anybody have ideas ;) )

      The brief case holding flash's items still need some work


Anyhow, I love HONEST opinion's! So any feedback I'll gobble up!




Attached Thumbnails

  • 23.png
  • asdef.png
  • aseffgfsd.png
  • freeMon.png

#5115049 2D mouse (rotation in 3D world)

Posted by markypooch on 07 December 2013 - 12:45 AM

Hello Once More!


It looks like your previous post is pointing towards specular highlighting :D If I could get that working its gonna be awesome. But for the time being Im gonna show my revised results with the point lights AND shading and let me know if im  a step closer. (I want to be at least somewhat closer before attempting specular lighting)




I think it looks a bit better. Let me know your opinion :) Once I get this to a decent point ill try specular highlights



#5113330 2D mouse (rotation in 3D world)

Posted by markypooch on 30 November 2013 - 02:11 PM

Yes, it does, quite well actually. My next step is to draw a cross hair in object space. That way you know what your shooting at.


And for some reason im picking up what your laying down.
Today must be one of those days


Im gonna give the projectile algorithm a shot (Get it :D)