Black Knight

GDNet+ Basic
  • Content count

    1186
  • Joined

  • Last visited

Community Reputation

769 Good

About Black Knight

  • Rank
    GDNet+

Personal Information

  1. Understanding Component-Entity-Systems

    The link to the follow up article is broken.
  2. The question of whether computers can think is just like the question of whether submarines can swim. -- Edsger W. Dijkstra
  3. Hey all, I just wanted to take the time to let everybody know that my startup is releasing our first product -- NodeBB, a forum built on Node.js, Redis, and Web sockets. http://www.nodebb.org https://github.com/designcreateplay/NodeBB The best part is the entire thing is open sourced from the start, so if this piques your interest, check out the code and jump right in! We're also raising money through a crowdfunding round at our Indiegogo page. Built on Node.js and Redis, we aim to tackle existing forums (almost all of which are built on LAMP stacks), and offer a product that aims to be an improvement on almost all levels... responsive design, two-way server-client communication, etc. Thanks!
  4. Understanding Component-Entity-Systems

    How would systems operate on a collection of components? And what would be a good way to store components? As I undersand from the article components derive from an interface and are stored under entities. This leads to me something like :       class IComponent{}; class Position : public IComponent { public: float x,y; }; class Velocity: public IComponent { public: float x,y; }; class Entity { public: std::vector<IComponent*> components; };       Afterwards a Physics system operates on the components of entities to add velocity to the position of these entities but how does that system work and decide if a component is a specific type(dynamic casts?virtual functions in the IComponent?). Would it be better to store components like so :       class Entity { public: std::map<std::string,IComponent*> components; };   So you can give names to components and access them with those names.   I think it could be nice to have a pt2 which goes a bit into implementation details.
  5. Planar projection shader

    After a while I realized that it ends up being the same thing :   0.5 * (output.position.w + output.position.x); 0.5 * output.position.w + 0.5 * output.position.x     Then in the pixel shader :   (0.5 * output.position.w + 0.5 * output.position.x) / output.position.w (0.5 * output.position.w)/output.position.w + (0.5 * output.position.x) / output.position.w     The first part becomes 0.5 :   0.5 + 0.5 * ( output.position.x / output.position.w)     This is equal to :   (output.position.x / output.position.w) / 2 + 0.5     I believe moving this calculation to the vertex shader is more efficient so I will just leave it there.
  6. I am  rendering a scene to a reflection texture and then drawing a water plane with that texture using projection. Most of the samples I have seen on the web pass in a view-projection matrix to the vertex shader and transform the vertex, then in the pixel shader they do :       projection.x = input.projectionCoords.x / input.projectionCoords.w / 2.0 + 0.5; projection.y = input.projectionCoords.y / input.projectionCoords.w / 2.0 + 0.5;     I have a shader that does the following and it works too but I don't know where I found this particular code or how it gives the same results with the above code. Here is the code I have   Vertex shader : (world is an identityMatrix, viewProj is my cameras combined viewProjection matrix:   output.position3D =  mul(float4(vsin.position,1.0), world).xyz; output.position = mul(float4(output.position3D,1.0), viewProj); output.reflectionTexCoord.x = 0.5 * (output.position.w + output.position.x); output.reflectionTexCoord.y = 0.5 * (output.position.w - output.position.y); output.reflectionTexCoord.z = output.position.w;     Pixel shader :      float2 projectedTexCoord = (input.reflectionTexCoord.xy / input.reflectionTexCoord.z);     What confuses me is the usage of "0.5 * (output.position.w + output.position.x)" and "0.5 * (output.position.w - output.position.y)". How does this have the same effect and what does the w component mean here?  
  7. Lol Chriz Metzen trolling at sony event.
  8. ???????????????????????? ??????????????????????? ????????????????????? ????????????????????