Page:33 - News Archived: 3437

Title Date
Reversed Shadow Map for omni-directional light - Link Sun, 13 Sep 2015 04:20:38

Ive been trying to get shadow maps working with omni-directional lights for quite a while and Im almost there. However Im currently stuck. I have the shadow maps working and rendering but it seems like all the shadows are in the reverse order for x-x and z-z. httpimgur.comgxVg0ZA httpimgur.comN4utMBz httpimgur.comcvtvYpm Has anyone else encountered this issue

program editting help - Link Sun, 13 Sep 2015 04:01:14

I need help editing this file. I want it to run as many times as the user wants it to. Please help Attached Files project.txt 24.69KB 26 downloads

Struggling with casting cloud shadow on earth sphere in OpenGL - Link Sun, 13 Sep 2015 03:29:58

I am trying to do an earth simulation in OpenGL with GLSL shaders and so far its been going decent. Although I am stuck with a slightly small problem. Right now I have 3 spheres one for ground level earth one for clouds and the third for the atmosphere scattering effects. The earth sphere handles with most of the textures. The cloud sphere is a slightly bigger sphere than the earth sphere and is mapped with a cloud texture and normal mapped using one created with the photoshop plugin. One more thing to point out is the rotation speed of the cloud sphere is slightly greater than the rotation speed of the earth sphere. This is where things get confusing for me. I am trying to cast the shadow of the clouds onto the ground earth sphere by passing the cloud texture into the earth spheres shader and subtracting the clouds color from earths color. But since the rotation speeds of the two spheres are different I figured if I multiplied the rotation matrix of the cloud sphere with the uv coordinates for the cloud texture that should solve the problem. But sadly the shadows and the clouds do not seem to rotate in sync. I was hoping if anyone can help me figure out the math to make the shadows and the cloud rotate in sync with each other no matter how different the rotation speeds of the two sphere are. Here is my fragment shader for the earth where Im calculating the clouds shadow version 400 core uniform sampler2D day uniform sampler2D bumpMap uniform sampler2D night uniform sampler2D specMap uniform sampler2D clouds uniform mat4 cloudRotation in vec3 vPos in vec3 lightVec in vec3 eyeVec in vec3 halfVec in vec2 texCoord out vec4 frag_color void main vec3 normal 2.0 texturebumpMap texCoord.rgb - 1.0 normal.z 1 - normal.x normal.x - normal.y normal.y normal normalize normal vec4 spec vec41.0 0.941 0.898 1.0 vec4 specMapColor texture2DspecMap texCoord vec3 L lightVec vec3 N normal vec3 Emissive normalize-vPos vec3 R reflect-L N float dotProd maxdotR Emissive 0.0 vec4 specColor spec powdotProd6.0 0.5 float diffuse maxdotN L 0.0 vec2 cloudTexCoord vec2cloudRotation vec4texCoord 0.0 1.0 vec3 cloud_color texture2D clouds cloudTexCoord.rgb vec3 day_color texture2D day texCoord .rgb diffuse specColor.rgb specMapColor.g - cloud_color 0.25 1 - cloud_color.r cloud_color.r diffuse vec3 night_color texture2D night texCoord .rgb 0.5 1 - cloud_color.r 0.5 vec3 color day_color ifdotN L lt 0.1 color mixnight_color day_color diffuse 0.1 5.0 frag_color vec4color 1.0 Heres a sample outputas a result of the above shader. Note that the shadows start out at the correct position but the due to the wrong rotation speed they tend to move ahead of the rotation of the cloud sphere. Again it would be really helpful if anyone can help me figure out the math behind keep the shadow and the clouds in sync Thanks in advance

Corrupted Vertex Buffer - Link Sat, 12 Sep 2015 23:52:02

Hi I am trying to render 2 vertex buffers. Each is setup a bit different. The first only has positions whereas the second has both positions and uv coordinates. If I only try to render one the one I render looks great. It doesnt matter which I render. But if I render both together both vertex buffer become corrupt. On screen they both look like triangles even though they are suppose to be quads. When I try making both use the same vertex format I.E. verts and uvs they render correctly. This almost makes me think that they are somehow referencing each other somehow which is breaking the stride. I am not explicitly unbinding my VBOs. According to the OpenGL docs I shouldnt need to. However even when I do it causes a crash. Below are the classes for the 2 VBOs in question. include QuadGeometry.h include ltiostreamgt using namespace std const float QuadGeometryverts91 -1.0f 1.0f 0.0f -1.0f -1.0f 0.0f 1.0f -1.0f 0.0f -1.0f 1.0f 0.0f 1.0 1.0 0.0f --------------------------------------------------------------------- void QuadGeometryInitialize glGenBuffers1 vertexBuffer glBindBufferGL_ARRAY_BUFFER vertexBuffer glBufferDataGL_ARRAY_BUFFER sizeofverts verts GL_STATIC_DRAW --------------------------------------------------------------------- void QuadGeometryRender glBindBufferGL_ARRAY_BUFFER vertexBuffer glDrawArraysGL_TRIANGLE_STRIP 0 5 --------------------------------------------------------------------- DisplayTextDisplayText shaderFx new ShaderFx shaderFx-gtLoad shadersfontvertex.glsl shadersfontfragment.glsl true vertexBuffer 0 textureSurface nullptr textureSurface SDL_LoadBMPassetstexturesddrsmall.bmp if textureSurface coutltlt Failed to Load Texturen glGenTextures1 textureId glBindTextureGL_TEXTURE_2D textureId glTexImage2DGL_TEXTURE_2D 0 3 textureSurface-gtw textureSurface-gth 0 GL_RGB GL_UNSIGNED_BYTE textureSurface-gtpixels glTexParameteriGL_TEXTURE_2D GL_TEXTURE_MIN_FILTER GL_LINEAR glTexParameteriGL_TEXTURE_2D GL_TEXTURE_MAG_FILTER GL_LINEAR --------------------------------------------------------------------- void DisplayTextCreateNewVertexBuffer float verts91 x y z u v -1.0f 1.0f 0.0f 0.0 1.0 -1.0f -1.0f 0.0f 0.0 0.0 1.0f -1.0f 0.0f 1.0 0.0 -1.0f 1.0f 0.0f 0.0 1.0 1.0f 1.0f 0.0f 1.0 1.0 glGenBuffers1 vertexBuffer glBindBufferGL_ARRAY_BUFFER vertexBuffer glBufferDataGL_ARRAY_BUFFER sizeofverts verts GL_STATIC_DRAW --------------------------------------------------------------------- void DisplayTextDrawStringstdstring string int x int y if vertexBuffer lt 0 CreateNewVertexBuffer shaderFx-gtBeginPass glmmat4 Projection glmperspective45.0f 800.0f600.0f 0.1f 1000.f glmmat4 View glmtranslateglmmat41.0f glmvec30.0f 0.0f -7.0f glmmat4 Model glmscaleglmmat41.0f glmvec31.0f glmmat4 modelViewMat View Model shaderFx-gtSetMatrix4x4ParametermodelViewMatrix modelViewMat910910 shaderFx-gtSetMatrix4x4ParameterprojectionMatrix Projection910910 glBindBufferGL_ARRAY_BUFFER vertexBuffer glDrawArraysGL_TRIANGLE_STRIP 0 5 shaderFx-gtEndPass oldString string Any ideas would be helpful Thanks

Minimalist 3D engine for CC - Link Sat, 12 Sep 2015 23:19:17

Ive discovered this amazing engine written in Rust a few days ago httpsgithub.comsebcrozetkiss3d Its simple but without making you lose your time and your sanity like bgfx does. And its powerful without making you vomit by too many features like Ogre. Does anyone know any engine with a similar philosophy in the C and C world

Ellipsoid Triangle Sweep Test troubles. - Link Sat, 12 Sep 2015 21:18:07

OK so there are people around the internet who claim that they can implement this collision detection alogorithmhttpwww.peroxide.dkpaperscollisioncollision.pdf without additional intersection check... In details this is a standard collision detection technique suitable for jumpnrun games like Rayman. The technique describes all the the moving entities with elliposid and all the static obsticles with tri-meshes. and then when moving those ellipsoids aunit sphere - triangle sweep test is performed. The sweep testin theory should give us a maxumum allowed travel distance without any intersection with any triangle. Soo.. Ive implemented this and It works amost eveytimebut sometimes when the sphere accidentaly gets too close to a triangle I get stuck not able to movesweep test always returns an intersection at moment t00.0f. This could be an error in my Sweep test implementataion i still cannot find it or it could be in the sliding implementation but certanly the floating point percison helps... In order to cure this isse Ive implemented a function that intersects a sphere with a triangle and returns a vector that will push the sphere out of the triangle. So my question is Have any of you implemented this technique without fixing the situation with intersection testsor ny analogue

Mesh pre-processing - Link Sat, 12 Sep 2015 20:35:16

With D3D12 out it seems feasible for me to try to do some screen space tiling in my renderer. So I find myself with the problem of figuring out how to divide my mesh into smaller clusters. So I was wondering if anyone had some resources on mesh feature detection and other mesh pre-processing functionality While I have a specific goal its about time I looked at mesh pre-processing in general so all resources are welcome. Thanks in advance.

Is it a good idea to scale models using vertexs w component in vertex - Link Sat, 12 Sep 2015 20:34:34

Maybe its very simplebut i googled without success.Will there be any problem to scale models by setting vertexs w componentthe last one in vertex shader is it freethat is to saywhether i set w or notdivided by w is performed all the time Besides this way only scale uniformly are there other drawbacksbecause those i googled all scaling by setting xyz.

D3D12 Barriers and Fences - Link Sat, 12 Sep 2015 19:54:35

Can anyone explain fences and resource barriers to me in the simplest fashion possible I am not used to such constructs and want to be sure I get it right.

DX12 Some structure have Int type which uses a specific enum. - Link Sat, 12 Sep 2015 19:08:25

I do not know why microsoft would do this. I think it would have make things easier to know which parameter they took especially when you have a enum define for something. Then in the structure instead of defining one of the attribute with that enum they pass an Int instead. A good example of that is enum D3D12_COMMAND_QUEUE_PRIORITY D3D12_COMMAND_QUEUE_PRIORITY_NORMAL 0 D3D12_COMMAND_QUEUE_PRIORITY_HIGH 100 D3D12_COMMAND_QUEUE_PRIORITY typedef struct D3D12_COMMAND_QUEUE_DESC D3D12_COMMAND_LIST_TYPE Type INT Priority D3D12_COMMAND_QUEUE_FLAGS Flags UINT NodeMask The Priority flag is a D3D12_COMMAND_QUEUE_PRIOORITY why the heck would they pass an Int. I know at the end of the day an enum is just an Int but it would have been more friendly and i would not need to look at the documentation to make sure that the correct Int values that can be passed are D3D12_COMMAND_QUEUE_PRIORITY. I am pretty sure they have similar issues throughout the API.

Problem implementing sequential impulse mass over 100Kg - Link Sat, 12 Sep 2015 18:21:36

Hi following the advice of some members of he forum I tried to implement the sequential impulse algorithm in a game physics demo its jus some boxes against the floor no friction no collision between boxes just the floor. It works for small masses below 100 Kg but above that it starts to bounce the demo have no restitution yet so this is unespected too. If I disable warmstarting this is what I got The boxes masses are 100 120 140 and 160 in kilograms gravity magnitude is 10 dt 1240 iterations 10 If I use 100 iterations it mitigates the problem a little and with 1000 it aparently disapears what could I be doing wrong I attach the arbiter contact constraint code package com.iigwo.physics_old import java.util.ArrayList import java.util.List import org.joml.Matrix3f import org.joml.Vector3f public class Arbiter private static final boolean WARMSTARTING false private static final boolean ACCUMULATE_IMPULSES false private static final boolean POSITION_CORRECTION true RigidBody b1 b2 final ListltContactgt contacts new ArrayListltgt public ArbiterRigidBody body1 RigidBody body2 this.b1 body1 this.b2 body2 public void updateListltContactgt newContacts if WARMSTARTING for Contact newContact newContacts for Contact oldContact contacts if newContact.matchesoldContact break contacts.clear contacts.addAllnewContacts public void preStepfloat inverseDt final float K_ALLOWED_PENETRATION 0.01f final float K_BIAS_FACTOR POSITION_CORRECTION 0.1f 0.0f Matrix3f iitiws1 b1.inverseInertiaTensorInWorldSpace Matrix3f iitiws2 b2.inverseInertiaTensorInWorldSpace Vector3f vr1 new Vector3f vr2 new Vector3f vr new Vector3f for Contact c contacts Vector3f n c.normal Vector3f t1 new Vector3f Vector3f t2 new Vector3f Vector3f r1 new Vector3fc.position.subb1.position Vector3f r2 new Vector3fc.position.subb2.position vr.setvr2.setb2.rotation.crossr2.addb2.velocity.subvr1.setb1.rotation.crossr1.addb1.velocity Vector3f vn new Vector3fn.mulvr.dotn Vector3f vt new Vector3fvr.subvn if vt.length gt 0 t1.setvt.normalize t2.sett1.crossn else System.out.printlnups t1.set1 0 0 t2.set0 1 0 c.bias c.bias -K_BIAS_FACTOR inverseDt Math.min0.0f c.separation K_ALLOWED_PENETRATION float kNormal 0 Vector3f r1Xn new Vector3fr1.crossn Vector3f r2Xn new Vector3fr2.crossn if b1.haveInfiniteMass kNormal b1.inverseMass n.dotiitiws1.transformr1Xn.crossr1 if b2.haveInfiniteMass kNormal b2.inverseMass n.dotiitiws2.transformr2Xn.crossr2 c.massNormal 1f kNormal if ACCUMULATE_IMPULSES Vector3f p new n if b1.haveInfiniteMass b1.velocity.fma-b1.inverseMass p b1.rotation.subiitiws1.transformnew Vector3fr1.crossp if b2.haveInfiniteMass b2.velocity.fmab2.inverseMass p b2.rotation.addiitiws2.transformnew Vector3fr2.crossp public void applyImpulse Matrix3f iitiws1 b1.inverseInertiaTensorInWorldSpace Matrix3f iitiws2 b2.inverseInertiaTensorInWorldSpace Vector3f vr1 new Vector3f vr2 new Vector3f vr new Vector3f for Contact c contacts Vector3f r1 new Vector3fc.position.subb1.position Vector3f r2 new Vector3fc.position.subb2.position Vector3f n c.normal vr.setvr2.setb2.rotation.crossr2.addb2.velocity.subvr1.setb1.rotation.crossr1.addb1.velocity float vn vr.dotn float dpn c.massNormal -vn c.bias if ACCUMULATE_IMPULSES float pn0 Math.maxpn0 dpn 0 dpn - pn0 else dpn Math.maxdpn 0 Vector3f pn new Vector3fn.muldpn if b1.haveInfiniteMass b1.velocity.fma-b1.inverseMass pn b1.rotation.subiitiws1.transformnew Vector3fr1.crosspn if b2.haveInfiniteMass b2.velocity.fmab2.inverseMass pn b2.rotation.addiitiws2.transformnew Vector3fr2.crosspn public static final float clampfloat f float min float max if f lt min return min if f gt max return max return f public boolean haveContacts return contacts.isEmpty

render any float value to 32bit depth buffer - Link Sat, 12 Sep 2015 15:39:28

Using directx 10 I changed DepthClipEnable FALSE and changed the viewport to vpTRY.MinDepth 0.0f vpTRY.MaxDepth 16777216.0f but I still cant render a 10.0f float value to the 32 bit depth buffer What else do I need to configure

cmake missing boost error - Link Sat, 12 Sep 2015 14:21:31

So Im trying to use cmake on the mysql c connector problem is i keep getting CMake Error at CMakeLists.txt159 MESSAGE Boost or some of its libraries found. If not in standard place please set -DBOOST_ROOTSTRING I tried to set an environment variable called DBOOST_ROOT that points to the directory in boost which contains all the headers CUsersNoatomDesktopboost_1_58_0boost However to no success. What am I doing wrong

Testing my Database pooling - Link Sat, 12 Sep 2015 13:57:18

Hey I want to test my database pooling so I figured to start queries on a separate thread. This works and I see the active and idle connections increase. But I had just a couple of these threads in line. For some real testing completely drain the pool and see what happens I figured to put the thread creation in a loop but this results in having at most 1 active connection and after thread 1 they all finish in 0ms. I have not done much with threads but its probably not a good idea to create those in a loop. for int i 0 i lt 100 i final int y i Thread t new Thread Override public void run long start System.nanoTime DataSourceExample db new DataSourceExample System.out.printlnThead y 1 finished in System.nanoTime - start 1000000 ms. But how can I stres test my MySQL database properly I am using java import org.apache.commons.dbcp2.BasicDataSource to create the pool. I have no experience with testing these.

cant create hardware d3d12 context only warp - Link Sat, 12 Sep 2015 11:55:54

hi there EDIT oh didnt see that theres a newer driver installing 355.82 solved it... I tried to run the DX12 hello window graphics sample httpsgithub.comMicrosoftDirectX-Graphics-SamplesblobmasterSamplesD3D12HelloWorldsrcHelloWindowD3D12HelloWindow.cpp but I can only run it if I setm_useWarpDevice to true meaning I can only create a warp device. I have a 64 bit windows 10 installed I tried to run the sample on a gtx660 using the latest driver 353.62. Nvidia control panel says I have dx12 runtime and api version but only feature level 11_0. DXDiag reports 11.3 directx version and says that the driver is wddm 2.0 capable but again it only lists feature levels up to 11_0. While I can still develop using a warp device Ill need the hardware device later so itd be great if I could solve this any idea how to fix this I tried to reinstall the display driver previously no success. best regards Yours3f

Is it worth to implement expression templates for vector2 3 and 4 - Link Sat, 12 Sep 2015 11:41:57

Is it worth to implement expression templates for classes representing two or three dimensional vector Expression templates improve performance however Im not sure if it is reasonable to implement such functionality when dealing with such simple class.

translate vector - Link Sat, 12 Sep 2015 11:26:17

hello i have a vector V v1 v2 and i would translate to the points a a1 a2. How i can do thatis a simple translation the direction must be the same for the vector v and vector a.thanks

Dx12 Need help with DescriptorHeap - Link Sat, 12 Sep 2015 11:00:02

Hi I was playing around with dx12 using sharpdx beta. Im able to render simple models now. However I went into troubles when trying to render models with several sub parts. The texture I uploaded is not displaying for second part. This is how I do it 1. Create a root signature var rootSignatureDesc new RootSignatureDescription RootSignatureFlags.AllowInputAssemblerInputLayout Root Parameters new91 new RootParameterShaderVisibility.All new 91 new DescriptorRange RangeType DescriptorRangeType.ShaderResourceView DescriptorCount 2 OffsetInDescriptorsFromTableStart -1 BaseShaderRegister 0 new DescriptorRange RangeType DescriptorRangeType.ConstantBufferView DescriptorCount 1 OffsetInDescriptorsFromTableStart -1 BaseShaderRegister 0 new RootParameterShaderVisibility.Pixel new DescriptorRange RangeType DescriptorRangeType.Sampler DescriptorCount 1 OffsetInDescriptorsFromTableStart -1 BaseShaderRegister 0 2. Create Descriptor Heap for srv and cbf var srvCbvHeapDesc new DescriptorHeapDescription DescriptorCount 3 Flags DescriptorHeapFlags.ShaderVisible Type DescriptorHeapType.ConstantBufferViewShaderResourceViewUnorderedAccessView srvCbvHeap device.CreateDescriptorHeapsrvCbvHeapDesc 3.Upload textures var tex Texture.LoadFromFile....modelstest.tga byte91 textureData tex.Data TextureWidth tex.Width TextureHeight tex.Height var textureDesc ResourceDescription.Texture2DFormat.B8G8R8A8_UNorm TextureWidth TextureHeight 1 1 1 0 ResourceFlags.None TextureLayout.Unknown 0 texture device.CreateCommittedResourcenew HeapPropertiesHeapType.Upload HeapFlags.None textureDesc ResourceStates.GenericRead null texture.Name Texture var handle GCHandle.AlloctextureData GCHandleType.Pinned var ptr Marshal.UnsafeAddrOfPinnedArrayElementtextureData 0 texture.WriteToSubresource0 null ptr TextureWidth 4 textureData.Length handle.Free 4. Create Shader Resource View Description for each texture by offsetting the heap address var Step device.GetDescriptorHandleIncrementSizeDescriptorHeapType.ConstantBufferViewShaderResourceViewUnorderedAccessView ...... device.CreateShaderResourceViewtexture91i srvDesc srvCbvHeap.CPUDescriptorHandleForHeapStart I Step 5.When building command list I set the descriptor table for each texture resource by offsetting commandList.SetGraphicsRootSignaturerootSignature DescriptorHeap91 descHeaps new91 srvCbvHeap samplerViewHeap commandList.SetDescriptorHeapsdescHeaps.GetLength0 descHeaps commandList.SetGraphicsRootDescriptorTable0 srvCbvHeap.GPUDescriptorHandleForHeapStart commandList.SetGraphicsRootDescriptorTable1 samplerViewHeap.GPUDescriptorHandleForHeapStart ...... draw first ...... commandList.SetGraphicsRootDescriptorTable0 srvCbvHeap.GPUDescriptorHandleForHeapStart Step i ...... draw second ...... But the thing is only the first part will have texture. Im still trying to understand how the whole resource management works but it looks so complex. Please help I checked the cpp sample code on GitHub but cant find what I did wrong. Thanks in advance.

when will we see DXGI_FORMAT_R64G64B64A64_FLOAT - Link Sat, 12 Sep 2015 10:30:14

Why havent GPUs made that full leap to 64 bit as CPUs have Is directx 12 going to add this format

Netbeans Bitmaps Jars and Manifests. - Link Sat, 12 Sep 2015 09:16:45

Hello there. I seem to be having trouble including a bitmap file in my projects JAR file using Netbeans. The actual Netbeans project I have called GraphicsStuff and I have written my own loader to load in Bitmap files and have successfully displayed the image in a window. Now Ive loaded in the bitmap as a resource instead of as a file and when I test the application in Netbeans it seems to work. So far so good. Here is where the problem rears its ugly head After I clean and build the project I then try to run the jar file outside of Netbeans and whilst I can get the window to display it does not display the bitmap image. In the Linux terminal I get the following message...Error Failed to load the file filehomestevenDesktopJavaStuffGraphicsStuffdistGraphicsStuff.jardatatitle.bmp No such file or directory ...which is really odd. I have included the bitmap file in its own folder in the Source packages drop-down list in the Projects tab viewer in Netbeans. Which is great because I can open the JAR itself and see that there is indeed a folder called data and it contains my bitmap file. So I know the bitmap IS in the JAR. However looking inside the Manifest.MF file thats inside the JAR file this is the contents...Manifest-Version 1.0 Ant-Version Apache Ant 1.9.4 Created-By 1.8.0_31-b13 Oracle Corporation Class-Path X-COMMENT Main-Class will be added automatically by build Main-Class graphicsstuff.GraphicsStuff it me or shouldnt there be something like dataimage.bmp in there somewhere From what I can tell the bitmap file is inside the JAR but the manifest doesnt know about it. Have I missed an important step here where Netbeans is concerned Cheers.

Cursor Position slowly becoming less pixel perfect when moving from - Link Sat, 12 Sep 2015 05:07:23

I am running into a really strange problem where the more I move away from the top-left of my windowed game the cursor position will slowly become further from the correct position. For example I have an 800 600 window that I print the mouse position to on the screen. When I move itto the bottom right of my window it is saying the position is 784 561. I create using CreateWindowExA with WS_EX_APPWINDOW as the first parameter extended style and the only window syle flag is WS_VISIBLE. I get the mouse position with POINT winCursorPoint GetCursorPoswinCursorPoint BOOL success ScreenToClientmWindowHandle winCursorPoint mCurrentMousePosition.x winCursorPoint.x mCurrentMousePosition.y winCursorPoint.y Is there some other window creation flag or mouse positioning calculation that needs to be done

Are there any good recommended open source .obj exporter - Link Sat, 12 Sep 2015 04:13:04 Probably need to add a feature namely excluding exportable sets that are objects are should not be counted as obstacles in the scene where they are editable polysmeshes like road signs on the ground. httpniftools.sourceforge.netwikiNifSkopeMesh_import_export I am not looking at this Thanks Jack

Why stdcopy is faster than stdmemcpy - Link Sat, 12 Sep 2015 00:32:05

Hi Why stdcopy is faster than stdmemcpy Possible implementation of stdcopy templateltclass InputIt class OutputItgt OutputIt copyInputIt first InputIt last OutputIt d_first while first last d_first first return d_first Thanks

FBX import from memory - Link Sat, 12 Sep 2015 00:19:32

Im trying to import an FBX file that is stored in memory with the Autodesk FBX SDK but with no luck. I have subclassed the FbxStream class to create a memory reader and is passing it into the importers Initialize method but I only get a fail result with the error message Unexpected file type. It seems to be reading a lot before it fails since I get may calls to my overloaded Read method so that seems to be working. Anyone here that have successfully loaded FBX files from a memory stream using the SDK

Bad performance when rendering medium amount of meshes - Link Fri, 11 Sep 2015 19:30:40

Im getting massive performance loss when rendering a medium-sized scene with a reasonable amount of meshes. The stats for all rendered non-occluded objects in the scene are Triangles 204432 Vertices 68449 Shader Changes glUseProgram 3 Material Changes glBindTexture 239 Meshes 7153 Render Duration 23ms 43fps I know that rendering a lot of low-poly meshes is a lot more expensive than rendering a handful of high-poly meshes but still 7153 meshes with an average of 28 triangles doesnt seem like a big deal to me and yet the performance goes down the drain. Before rendering all of my meshes are first sorted by shader then by material. The main render process is as follows foreach shader glUseProgramshader foreach material glBindTexturematerial foreach mesh glBindVertexArrayvao Vertex Array Vertex UV Normal Buffers glBindBufferibo Index Buffer glDrawElementsGL_TRIANGLESvertexCountGL_UNSIGNED_INTvoid0 end end end Pseudo Code I have a decent graphics card AMD Radeon R9 200 Series which I believe should be able to handle a lot more stress than this. Ive spent hours profiling with both CPU and GPU profilers debugging trying various optimization methods but the bottleneck is definitely the central rendering process Code above. Is the amount of meshes really the problem here If not what could be causing this massive decrease in performance Im not looking for culling methods right now Im just trying to improve my rendering pipeline.

Game server security for Android game. - Link Fri, 11 Sep 2015 13:46:36

I worked a bit with KryoNet and created a simple Android chat clientserver where the server just forwards messages to the connected clients. It was incredibly easy to setup and now I want to create a turn based combat game with some RPG elements for android. You have several professional games like this around. They all heavily rely on the server to do the logic and retrieving player information like inventory characters etc. for good reasons of course. But Im still wondering about some things and a couple of practical examples would be great. What would be a good way to store things on the server side If we have a look at my Heroes they can be customized so there will be many of the same types of heroes but they will mostly. Same goes for items attributes on items get rolled randomly. So all this needs to be stored individually. A database on the server side sounds good. I can add all items to a player inventory and link them when a Hero equips them. I expect the database will grow very quickly even if my game just has a couple of hundred active players. And I am not certain how well a Raspberry Pi will handle a ton of queries. I have some experience with MySQL and MSSQL and know how to build prepared statments against injection. How different would this be security wise Can a published APK be unpacked and show all my queries And where to store the DB credentials. If Im going to do this I pretty much want this to be water tight and worse case scenario have frequent backups. Raw files like XML files would be pretty good too I think. I have to write and read files every time the player changes or requests information. But these files will generally be very short and I know the exact location of them. This means no multiple complicated DB queries. Security wise I have no clue how good this is or should I say how bad this is A database can obviously be protected very well files are just files whenever someone gets access to the server I will be screwed I guess. Regarding combat and other player interactions should I do all the calculations on the server side Or can I let the client handle most things How do semi professional games handle this Should I sent something like playerX wants to attack heroA from playerY with heroB. And do all calculations at the server. A lot of data need to travel through the server this way. Very secure I guess in terms of cheating. But is this really nececary I could resolve combat on the client side and just send the damage and a heroID or other small data over. Small packets relieving stress on the server. Prone to cheating How big is the chance that someone sends packages to my server and accepts that package For KryoNet they have to be sending the same package class and I can add additional protection for this. I initially want to run my server on my own network on a Raspberry Pi. After publishing would this be a bad idea for any reason and should I pay for a host

SDL Games - Link Fri, 11 Sep 2015 12:22:35

Hey guys Where i can found source code game written in SDL I need simple games to learn in pratice. Thanks everyone

Bones weights - Link Fri, 11 Sep 2015 11:01:28

Hello I just have a simple question. I have an animated mesh and want to improve some animations in my framework. Actually each bone has two more influence bones. Thinking on it I feel it could be even more realistic if it should be weghted by at least four or five bones with each respective weights but how should I achieve that Actually my vertex declaration is D3DVERTEXELEMENT9 decl_skinning91 2 0 D3DDECLTYPE_SHORT4 D3DDECLMETHOD_DEFAULT D3DDECLUSAGE_BLENDINDICES 0 2 8 D3DDECLTYPE_FLOAT3 D3DDECLMETHOD_DEFAULT D3DDECLUSAGE_BLENDWEIGHT 0 0 0 D3DDECLTYPE_FLOAT3 D3DDECLMETHOD_DEFAULT D3DDECLUSAGE_POSITION 0 0 12 D3DDECLTYPE_FLOAT3 D3DDECLMETHOD_DEFAULT D3DDECLUSAGE_NORMAL 0 0 24 D3DDECLTYPE_D3DCOLOR D3DDECLMETHOD_DEFAULT D3DDECLUSAGE_COLOR 0 0 28 D3DDECLTYPE_FLOAT2 D3DDECLMETHOD_DEFAULT D3DDECLUSAGE_TEXCOORD 0 On the shader vertex side struct VS_SKINNING int4 boneNdxs BLENDINDICES float3 weights BLENDWEIGHT How should I do with such limitation Thanks in advance.

D language array syntax question - Link Fri, 11 Sep 2015 10:24:16

ulong9191uint _IpIdCache _IpIdCache91date 91record.IpId record.IpId is just an unsigned long date is an unsigned int So _IpIdCache is an associative array that contains arrays of type ulong indexed by uints. Im not entirely sure what is happening here _IpIdCachedate record.IpId is record.IpId turned into an array with a single element and then added to _IpIdCache with the index of date Or did I get that entirely wrong

Workstation for game design3d Modelingrendering - Link Fri, 11 Sep 2015 07:27:29

I need help on building a workstation for game design3d Modelingrendering and some gaming. Software that Ill be using will be Unity 3d blender. My budget is 2000 to 2500. Also any recommendations on a good Ips monitor and video card. Any advice that can be given would be greatly appreciated.

Running Shader in DX9 Returns Previous Frame - Link Fri, 11 Sep 2015 05:36:01

I finally got the code to run a HLSL pixel shader in DX9 almost working. httpsgithub.commysteryx93AviSynthShaderblobmasterVideoPresenterD3D9RenderImpl.cpp Heres a weird issue Im still having. As I load the script the first frame is black which is OK. Then the first time I seek towards a different frame the frame remains black. The second time I seek to another frame the first frame is returned. It seems to always returns the frame data of the previous call. So if I make a diff between the input and output frames of the shader it looks totally wrong because its a diff between two different frames. Why is it not returning me the current frame data right away ... just a thought ... could it be that the frame isnt done being processed when I call to get the result

A Beginners DFS Maze Problem - Link Fri, 11 Sep 2015 02:56:17

Hi I have been using this site www.migapro.comdepth-first-search to learn about how to do mazes I have got it setup and it works ok but I have a problem. Sometimes when the map is created it doesnt find every possible path to create a maze. I have been able to work out a formula based on the size of the maze to determine how many grid tiles should be used to make the map and if that size is not correct then redo the map. Id like not to have to redo the whole map or understand why it fails to fill all possible grid positions. Im still a beginner and am starting to understand how the recursion works. If you could have a look over my code and point out what I should be looking at to find the error. It only happens like 1 in 10 times. I think it is in the direction it randomly chooses to travel in.... in this case it didnt go up at all. Here is a picture of one of the bad maps. and here is the code GenerateMazeGenerateMazeint mazex int mazey numberofcells mazesizemazesize mazesizex mazex mazesizey mazey Directiontotravel.push_backDirectionUp Directiontotravel.push_backDirectionDown Directiontotravel.push_backDirectionLeft Directiontotravel.push_backDirectionRight bool GenerateMazeGenerateNewMazeint mazearray91 int mazexsize int mazeysize systemCLS maze maker magic use recursion rather than a stack. ClearMazemazearray int startpoint mazesize1 Visited91startpoint true mazearray91startpoint 1 int xposcell startpoint mazesizex x pos in tiles int yposcell startpoint mazesizey y pos in tiles reduce number of cells by 1 for starting location aswell numberofcells-- call recursion function bool succeeded Generatemazearray xposcell yposcell return succeeded bool GenerateMazeGenerateint mazearray91 int x int y int newtile -1 int betweentile -1 stdrandom_shuffleDirectiontotravel.begin Directiontotravel.end for int a 0 a lt intDirectiontotravel.size a switch Directiontotravel91a case DirectionUp if y - 2 lt 0 continue newtile x y-2 mazesizex betweentile x y - 1 mazesizex if Visited91newtile Visited91betweentile tiles have not been visited Visited91newtile true Visited91betweentile true mazearray91newtile 1 mazearray91betweentile 1 numberofcells - 2 int newx newtile mazesizex int newy newtile mazesizey Generatemazearray newx newy break case DirectionDown if y 2 gt mazesizey - 1 continue newtile x y 2 mazesizex betweentile x y 1 mazesizex if Visited91newtile Visited91betweentile tiles have not been visited Visited91newtile true Visited91betweentile true mazearray91newtile 1 mazearray91betweentile 1 numberofcells - 2 int newx newtile mazesizex int newy newtile mazesizey Generatemazearray newx newy break case DirectionLeft if x - 2 lt 0 continue newtile x - 2 y mazesizex betweentile x - 1 y mazesizex if Visited91newtile Visited91betweentile tiles have not been visited Visited91newtile true Visited91betweentile true mazearray91newtile 1 mazearray91betweentile 1 numberofcells - 2 int newx newtile mazesizex int newy newtile mazesizex Generatemazearray newx newy break case DirectionRight if x 2 gt mazesizex - 1 continue newtile x 2 y mazesizex betweentile x 1 y mazesizex if Visited91newtile Visited91betweentile tiles have not been visited Visited91newtile true Visited91betweentile true mazearray91newtile 1 mazearray91betweentile 1 numberofcells - 2 int newx newtile mazesizex int newy newtile mazesizex Generatemazearray newx newy break return true bool GenerateMazeClearMazeint mazearray91 for auto a Visited a false for int x 0 x lt mazesizexmazesizey x mazearray91x 0 return true Thanks for reading werdy666

Whats True -1 - Link Fri, 11 Sep 2015 02:45:58

A bug in my code which i found was due to missed brackets has led to some other questions what is True -1 for clarity I will oversimplify the code My code shoud have been like this if q hh - 1.0f ... But i missed some brackets so i had typed this if q hh - 1.0f ... So i guess the compiler im using Android Java on eclipse... ...would treat the missed brackets code as if q hh - 1.0f ... except if im mistaken about the precedence in other words if true - 1.0f .... or if false - 1.0f .... to find out what the consequence of my mistake was i was asking whats TRUE - 1 But i dont know does anyone know

Position constraints converging slowly contacts - Link Thu, 10 Sep 2015 22:33:00

I implemented an iterative constraint solver using impulses as described in Bender Schmitt 2006 httpwww.researchgate.netpublication228934234_Constraint-based_collision_and_contact_handling_using_impulses Solving for the normal penetration constraint or the tangent constraint in isolation converges as expected about 4-5 iterations before the penetration or tangent position is within the target range lt0.0001. But running both constraints simultaneously causes 150 iterations before they are both within target which sounds like too much for a single constraint but maybe it is expected for a tight constraint

Is there a language like Python but without the tab requirement - Link Thu, 10 Sep 2015 22:01:04

I was just wondering. I would like to learn a language like Python but I dont need the tabwhitespace restriction.

Need help. 2D Text with transparency without using ID3DXFont - Link Thu, 10 Sep 2015 21:39:36

For a pet project of mine Im trying to replicate the behavior of the ID3DXFont interface from d3dx9 that is render arbitrary 2D text with arbitrary color and arbitrary but uniform transparency. If you remember what ID3DXFont does you know exactly what Im trying to do. No more and no less. Im using Direct3D9 because its the API Im more familiar with. Direct3D9 can use shaders but I want to use only the FFP because if successful Ill port this to older API versions D3D8 and D3D7. The project is nearly complete but I miss the last piece of the puzzle. The theory is simple. Prepare a texture. Draw text on the texture. Slap the texture on a 2D quad in transformed space. Render the quad on the backbuffer. The framework is in place and works as intended already. The help I need concerns the correct setup of RenderStates and maybe the TextureStageStates. Look I dont know. I never could grasp how blending worked. And as much as I try now I cant seem to overcome this beast by myself. This is what I do 1 Create a Texture to work with. This has the same color format of the backbuffer. No Alpha channel allowed because GDI has no well-defined behavior in such case Microsofts words more or less. Lets assume my work Texture is of the X8R8G8B8 format. 2 Use the Windows API DrawText from GDI to print formatted text on the work Texture. At the moment the text is printed in White color over a Black background. Just like in this sample image I repeat no Alpha information is present. The idea was to use the very textures colors as the Alpha 255 -opaque- where the White is and 0 -transparent- where the Black is. 3 Prepare a quad in transformed space set it to use the work texture. And render it on the backbuffer with a call to DrawPrimitive. The quads vertices have an ARGB Diffuse color. This color is meant to provide the final Alpha and RGB color to the text printed on the work texture such that if I set a Diffuse of ARGB127 255 0 0 the final text color on the backbuffer should appear 50 translucent Red. The only thing of the work texture that must NOT show up ever is the Black background. How do I make it disappear Please help me.

Sort unit vectors clockwise - Link Thu, 10 Sep 2015 21:26:13

I dont actually need to code this anywhere. I just was thinking about how an algorithm to sort a circular list of unit vectors to be in a clockwise order would work. Conditions After sorting it doesnt matter what unit vector is first in the list as long as each adjacent unit vector in the list is clockwise to the last without any other unit vector between them The list is circular so the first vector in the list follows the last vector. My own restriction here but no trig functions allowed Eg no atan2 atan ect Use dot products or cross products instead I have already come up with an algorithm that kinda looks like a bubble sort but has the draw back of being On2 complexity. Any On log n solutions Edit Just after posting I realized that this could be solved pretty trivially by using any sort function with simple comparison function that checks the sign of the x component and sorts on the y. I guess I could also add the restriction that they arent unit vectors and you arent allowed to normalize them to make the problem more difficult again.

Error with shaders - OpenGL - Link Thu, 10 Sep 2015 18:41:01

Hello guys When I compile there is an error which says Failed to compile shader Vertex shader failed to compile with the following errors ERROR 01 error132 Syntax error lt parse error ERROR error273 1 compilation errors. No code generated Here you go my vertex shader version 330 core layout location 0 in vec4 position uniform mat4 pr_matrix mat41.0 uniform mat4 vw_matrix mat41.0 uniform mat4 ml_matrix mat41.0 void main gl_Position position Any ideas

Setting Up a Design Document seeking Advice - Link Thu, 10 Sep 2015 18:10:03

Hello Forum. Im new here. I am very interested in putting a design document together for a side project. Really its more of a learning experience than anything else and I relish the opportunity to pick the brains of people that know so much about programming. Firstly a bit of background. This will help you as a community know where im coming from and where the gaps in my own knowledge might lie. I minored in computer science in college and at the institution we mostly focussed on C and the basics of object oriented programming. It was essentiallly Hello World sort of stuff that quickly snowballed into inheritence polymorphism etc. Its been a year or two since ive gotten out of school and I find myself having to do a lot of review. I am by no means a virtuoso or expert programmer. Just a guy who wants to learn as much as possible and will consume any learning resource presented. I am currently using Devc. Now to my question. Based on the way I want this game to work I am going to require a lot of moving UI elements inbetween more active phases of the game. I have no background in UI and am not sure where to begin looking to fill my gaps in knowledge. From a quick google search I only understand that the question of C based UI is an incredibly broad one that requires a bit of specificity on part of the person asking the question. I want to code a UI that allows for a user to quickly gauge inventory and other game metrics before moving on to another UI in another phase of the game. If anyone has a resource that would give me a crash course into its design and implimentation I would be very grateful. If I am not asking the right question I would not balk at any correction or clarification offered.

Help me find tutorial to make this type of game - Link Thu, 10 Sep 2015 17:00:33

I want to find beginner friendly tutorial on how to make the classic top-down The Legend of Zelda using GameMaker Studio. I know some basic coding stuff but I still would like to have a beginner friendly tutorial so that I can keep up with it.

Gaming News Headlines - Yahoo News - Link Sat, 12 Sep 2015 08:21:00

ltpgtlta 30 height86 altXbox Oneamp039s Sea of Thieves is ampquotThe Best Game That Rare Has Ever Madeampquot alignleft titleXbox Oneamp039s Sea of Thieves is ampquotThe Best Game That Rare Has Ever Madeampquot border0 gtltagtMicrosoft executive Kudo Tsunoda says the gameamp039s user-generated content component will be a major selling point.ltpgtltbr clearallgt

Xbox Ones Sea of Thieves is The Best Game That Rare Has Ever Made - Link Sat, 12 Sep 2015 08:00:00

ltpgtlta 30 height86 altWeekly Recap PS4 Outsells Xbox One Again But Xbox One Has Best Exclusives alignleft titleWeekly Recap PS4 Outsells Xbox One Again But Xbox One Has Best Exclusives border0 gtltagtHere are some of the big stories from this week and some you may have missed.ltpgtltbr clearallgt

Weekly Recap PS4 Outsells Xbox One Again But Xbox One Has Best - Link Fri, 11 Sep 2015 17:13:00

ltpgtlta 30 height86 altWhat Are the Top 5 Video Game Franchises and Consoles alignleft titleWhat Are the Top 5 Video Game Franchises and Consoles border0 gtltagtNew infographic breaks it down.ltpgtltbr clearallgt

What Are the Top 5 Video Game Franchises and Consoles - Link Fri, 11 Sep 2015 16:32:00

ltpgtlta 30 height86 altFree Madden 16 PS4Xbox One Update Makes Players Look More Lifelike alignleft titleFree Madden 16 PS4Xbox One Update Makes Players Look More Lifelike border0 gtltagtEric Weddle finally gets his beard thanks to player likeness update on PlayStation 4 and Xbox One.ltpgtltbr clearallgt

Free Madden 16 PS4Xbox One Update Makes Players Look More Lifelike - Link Fri, 11 Sep 2015 14:08:13

ltpgtlta 30 height86 altXbox One amp039gaining momentumamp039 Microsoft says alignleft titleXbox One amp039gaining momentumamp039 Microsoft says border0 gtltagtMicrosoftamp039s console loses to PS4 in August but sales are up 26 percent compared to last year.ltpgtltbr clearallgt

Xbox One gaining momentum Microsoft says - Link Fri, 11 Sep 2015 13:33:00

ltpgtlta 30 height86 altFire Emblem and Shin Megami Tenseiamp039s Wii U Crossover Dated in Japan alignleft titleFire Emblem and Shin Megami Tenseiamp039s Wii U Crossover Dated in Japan border0 gtltagtNintendo also announces a special edition and system bundle.ltpgtltbr clearallgt

Fire Emblem and Shin Megami Tenseis Wii U Crossover Dated in Japan - Link Fri, 11 Sep 2015 12:30:02

ltpgtlta srchttpl1.yimg.combtapires1.2tPbk1.zItTLDzvoXvrUWaw--YXBwaWQ9eW5ld3NfbGVnbztmaT1maWxsO2g9ODY7cT03NTt3PTEzMA--httpmedia.zenfs.comen-UShomerunpolygon.vox.comb20988391000a89c11ac297dc928e753 30 height86 altInfinity Blade 3 is free and so are 7600 beautiful assets from a mysterious spinoff alignleft titleInfinity Blade 3 is free and so are 7600 beautiful assets from a mysterious spinoff border0 gtltagtChair Entertainment is celebrating five years of Infinity Bladeby giving away the seriesamp039 latest game and more than 7600 game assets many froma planned spinoff that never materialized. Infinity Blade 3 2013amp039s entry in the still-beautiful series of mobile fighting games is freethrough the iOS App Store. The celebration continues with an asset giveaway from Epic Games Chairamp039s parent company.ltpgtltbr clearallgt

Infinity Blade 3 is free and so are 7600 beautiful assets from a - Link Fri, 11 Sep 2015 12:11:00

ltpgtlta 30 height86 altXbox One Exec No Doubt We Have Best Exclusives This Holiday alignleft titleXbox One Exec No Doubt We Have Best Exclusives This Holiday border0 gtltagtampquotThereamp039s no way that people can really stack up with our exclusive content.ampquotltpgtltbr clearallgt

Xbox One Exec No Doubt We Have Best Exclusives This Holiday - Link Fri, 11 Sep 2015 12:09:30

Its been a heck of a week for Apple fans but its not over just yet. Weve got one last list ofpaidiPhone andiPadapps on sale for free for you today and youll definitely want to stock up on nifty new apps in preparation for your new iPhone 6s. There are also a few apps that are still free on yesterdays listincluding Infinity Blade III so be sure to check that one out. DONT MISS10 hacks that will change the way you use Gmail These are paid iPhone and iPad apps that have been made available for free for a limited time by their developers. There is no way to tell how long they will be free. These sales could end

10 awesome paid iPhone apps on sale for free today - Link Fri, 11 Sep 2015 10:57:00

ltpgtlta 30 height86 altXbox One Power Supply Units Now Available to Buy alignleft titleXbox One Power Supply Units Now Available to Buy border0 gtltagtYou can get a new one for as little as 35 if itamp039s not covered under your warranty.ltpgtltbr clearallgt

Xbox One Power Supply Units Now Available to Buy - Link Fri, 11 Sep 2015 08:35:25

In the annals of video game history theres perhaps no game more recognizable nor more iconic than the original Super Mario Bros. title for NES. Even folks who are decidedly not into video games have likely played World 1-1 on Mario Bros. at some point in their lives. Designed by legendary video game designerShigeru Miyamoto the first level of Super Mario Bros. is widely heralded as a game design triumph thats as instructive as it is fun to play. Earlier this week Miyamoto and Takashi Tezuka sat down for an enlightening interview with Eurogamer to discuss some of the strategies that went into designing World 1-1. DONT MISSForget USB-C theres finally a company that makes reversible micro USB cables As

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68

Welcome to

Floating Point Softwares is an Indie company started in 2015
focusing mainly on Android, iOS, HTML5 and PC game development.
Currently we also offer non-game related solutions, 
such as mobile apps depending on the demand, as well as pixel & vector graphics.

Read more

What's Going On?

Featured Shop Items