Search Results

Search found 28 results on 2 pages for 'codymanix'.

Page 1/2 | 1 2  | Next Page >

  • Different ways to pass Textures into HLSL shaders

    - by codymanix
    The GraphicsDevice class of xna 4 has the properties Textures and VertexTextures. What is the exact difference? I don't really understand what MSDN tells me about this. I usually use Effect parameters to pass textures to my HLSL shaders. What are the differences between these methods, which is faster? My Scenario: I am working on a minecraft like game, which means lots of separate DrawPrimitives calls and change current Texture often since I have lots of different block types. Since I use an Octtree to organize the world, I cannot easily sort by texture.

    Read the article

  • Fast lighting with multiple lights

    - by codymanix
    How can I implement fast lighting with multiple lights? I don't want to restrain the player, he can place an unlimited number and possibly overlapping (point) lights into the level. The problem is that shaders which contain dynamic loops which would be necessary to calculate the lighting tend to be very slow. I had the idea that if it could be possible at compiletime to compile a shader n times where n is the number of lights. If the number n is known at compiletime, the loops can be unrolled automatically. Is this possible to generate n versions of the same shader with just a different number of lights? At runtime I could then decide which shader to use for which part of the level.

    Read the article

  • Fast lighting with multple lights

    - by codymanix
    How can I implement fast lighting with multiple lights? I don't want to restrain the player, he can place an unlimited number and possibly overlapping (point) lights into the level. The problem is that shaders which contain dynamic loops which would be necessary to calculate the lighting tend to be very slow. I had the idea that if it could be possible at compiletime to compile a shader n times where n is the number of lights. If the number n is known at compiletime, the loops can be unrolled automatically. Is this possible to generate n versions of the same shader with just a different number of lights? At runtime I could then decide which shader to use for which part of the level.

    Read the article

  • Managed game frameworks with Model loading support [on hold]

    - by codymanix
    Iam looking for an alternative to XNA with support of model loading. Does anybody know when/if there if a MonoGame release is planned which includes its own content pipeline which works without XNA beeing installed? If not, what are the alternatives in managed game development? As far as I know, SlimDX and SharpDX on its own brings no functionality for loading models. Are there any open source libraries that can do that?

    Read the article

  • Strange thing about .NET 4.0 filesystem enumeratation functionality

    - by codymanix
    I just read a page of "Whats new .NET Framework 4.0". I have trouble understanding the last paragraph: To remove open handles on enumerated directories or files Create a custom method (or function in Visual Basic) to contain your enumeration code. Apply the MethodImplAttribute attribute with the NoInlining option to the new method. For example: [MethodImplAttribute(MethodImplOptions.NoInlining)] Private void Enumerate() Include the following method calls, to run after your enumeration code: * The GC.Collect() method (no parameters). * The GC.WaitForPendingFinalizers() method. Why the attribute NoInlining? What harm would inlining do here? Why call the garbage collector manually, why not making the enumerator implement IDisposable in the first place? I suspect they use FindFirstFile()/FindNextFile() API calls for the imlementation, so FindClose() has to be called in any case if the enumeration is done.

    Read the article

  • How to get index using LINQ?

    - by codymanix
    Given a datasource like that: var c = new Car[] { new Car{ Color="Blue", Price=28000}, new Car{ Color="Red", Price=54000}, new Car{ Color="Pink", Price=9999}, // .. }; How can I find the index of the first car satisfying a certain condition with LINQ? EDIT: I could think of something like this but it looks horrible: int firstItem = someItems.Select((item, index) => new { ItemName = item.Color, Position = index }).Where(i => i.ItemName == "purple") .First() .Position; Will it be the best to solve this with a plain old loop?

    Read the article

  • What sense does asynchronous IO make if the thread is blocked anyway (see example)

    - by codymanix
    Hello, I found an example for async ftp upload on msdn which does the following (snippet): // Asynchronously get the stream for the file contents. request.BeginGetRequestStream( new AsyncCallback (EndGetStreamCallback), state ); // Block the current thread until all operations are complete. waitObject.WaitOne(); The thing what I do not understand here is, which sense does asynchronous IO make if the thread is blocked anyway with an explicit waithandle. I always thought the advantage of asynchronous IO was that the user/programm does not have to wait.

    Read the article

  • WPF: KeyboardNavigationMode.Contained doesn't work to suppress focus wrap

    - by codymanix
    I want to navigate in my window with the arrow key. It works so far but if I reach the end of my window, focus wraps to the first main menu item. But I want that focus stops at the last control in my window. private void Window_PreviewKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Down) { elem.MoveFocus(FocusNavigationDirection.Next); } } "elem" is indirect child control of "stackPanel". MoveFocus always returns true and I already tried: KeyboardNavigation.SetTabNavigation(stackPanel, KeyboardNavigationMode.Contained); KeyboardNavigation.SetDirectionalNavigation(stackPanel,KeyboardNavigationMode.Contained); KeyboardNavigation.SetControlTabNavigation(stackPanel, KeyboardNavigationMode.Contained); Nothing helped.

    Read the article

  • Fast search in XMl files in .NET (or How to index XML files)

    - by codymanix
    I have to implement a search feature which is able to quickly perform arbitrary complex queries to XML-data. If the user makes a query, all XML files must be searched to find possible matches. The users will have lots of XML-Files (a few 10000 or more) which are typically a few kilobytes in size. All the XML-files have almost the same structure. I already benchmarked XPath, it is too slow for my needs. How can it be done most efficiently? Is is possible to create indexes for the contents of the XML files (preserving content semantics, not just plain fulltext search)? Will it be useful to put the XML data into an (embedded) SQL database and do the queries with SQL? What other possibilities do I have?

    Read the article

  • Getting Dictionary<string,string> from List<Control>

    - by codymanix
    I want a dictionary containing the names and text of all controls. Is it possible with predefined framework methods/LINQ/colection initializers or do I have to make a loop and add all entries by myself? This gives me an error message: List<Control> controls; // .. initialize list .. controls.ToDictionary((Control child,string k)=>new KeyValuePair<string,string>(child.Name, child.Text));

    Read the article

  • Array.BinarySearch where a certain condition is met

    - by codymanix
    I have an array of a certain type. Now I want to find an entry where a certain condition is met. What is the preferred way to do this with the restriction that I don't want to create a temporary object to find, but instead I only want to give a search condition. MyClass[] myArray; // fill and sort array.. MyClass item = Array.BinarySearch(myArray, x=>x.Name=="Joe"); // is this possible? Maybe is it possible to use LINQ to solve it?

    Read the article

  • Good library to load images of different formats

    - by codymanix
    Hi Iam developing an image viewer application just like irfan-view or acdsee which should be capable to view lots of different image file formats (not just the standard ones which can be done with System.Drawing.Image). Iam currently using ImageMagick but it isn't very fast and seems to be unstable with some image files. Can anyone suggest a good imaging library, ideally with a .NET wrapper already present?

    Read the article

  • html-login form not working

    - by codymanix
    I have a child page LoginContent.aspx which contains a login form. If the user logs in he should be redirected to my Welcome.aspx page. But if I press the login button the page just reloads itself, nothing happens. The codebehind on this page is empty. Both LoginContent.aspx and Welcome.aspx are child forms of the same master page. <form method="post" action="~/Welcome.aspx"> Username: <input type="text" name="username" size="15" /><br /> Password: <input type="password" name="passwort" size="15" /><br /> <input type="submit" value="Login"/></p> </form> I know I could use the asp.net login control but I want more control over things.

    Read the article

  • Strange thing about .NET 4.0 filesystem enumeration functionality

    - by codymanix
    I just read a page of "Whats new .NET Framework 4.0". I have trouble understanding the last paragraph: To remove open handles on enumerated directories or files Create a custom method (or function in Visual Basic) to contain your enumeration code. Apply the MethodImplAttribute attribute with the NoInlining option to the new method. For example: [MethodImplAttribute(MethodImplOptions.NoInlining)] Private void Enumerate() Include the following method calls, to run after your enumeration code: * The GC.Collect() method (no parameters). * The GC.WaitForPendingFinalizers() method. Why the attribute NoInlining? What harm would inlining do here? Why call the garbage collector manually, why not making the enumerator implement IDisposable in the first place? I suspect they use FindFirstFile()/FindNextFile() API calls for the imlementation, so FindClose() has to be called in any case if the enumeration is done.

    Read the article

  • How to integrate conditional logic in postbuild events

    - by codymanix
    Hi I have a visual studio project which includes postbuildevents in the following form: MyTool.exe $(ProjectDir)somesrcfile.txt $(TargetDir)sometargetfile.bin Now I want to add some logic saying that these steps are taking place only if the files have changed. In peudocode: if (somesrcfile.txt is newer than sometargetfile.bin) { MyTool.exe $(ProjectDir)somesrcfile.txt $(TargetDir)sometargetfile.bin } Can I do this with MsBuild?

    Read the article

  • add assembly reference dialog

    - by codymanix
    Is there a way to use visual studio's "add assembly reference dialog" (or something similar) in my own application? I need it for dynamic code generation and compilation. This is not simply an OpenFileDialog, since it additionally looks into the GAC and so on, so it will be very complicated to do it on my own, I think. If this is not possible, how can I get a list of all assemblies from the GAC?

    Read the article

  • AutoScaleMode.Inherit does not inherit

    - by codymanix
    I have a user control contained in a tabpage. The Form has set AutoScaleMode = AutoScaleMode.Font and the UserControl has set AutoScaleMode.Inherit. Now when I enlarge the font size of the form then the font is enlarged in the user control too, but the controls contents are not scaled. If I explicitly set AutoScaleMode.Font on the user control then it works properly. Shouldn't AutoScaleMode.Inherit work that way?

    Read the article

  • InvalidOperationException when using soap client

    - by codymanix
    I've added as wsdl file using the add servece reference dialog in vs2008. MyService serviceproxy = new MyService(); When I instantiate the service proxy, I get an InvalidOperationException with the following text (translated from german): Could not find default endpoint element to the contract "ServiceName.ServiceInterface" in the service model refers client configuration section. This may be because: The application configuration file was not found or not an endpoint in the client element item is found, which corresponded to this contract. Where servicename is the name I give the service when I add it in vs2008 and ServiceInterface the interface which is automatically generated for it.

    Read the article

  • Strange performance behaviour for 64 bit modulo operation

    - by codymanix
    The last three of these method calls take approx. double the time than the first four. The only difference is that their arguments doesn't fit in integer anymore. But should this matter? The parameter is declared to be long, so it should use long for calculation anyway. Does the modulo operation use another algorithm for numbersmaxint? I am using amd athlon64 3200+, winxp sp3 and vs2008. Stopwatch sw = new Stopwatch(); TestLong(sw, int.MaxValue - 3l); TestLong(sw, int.MaxValue - 2l); TestLong(sw, int.MaxValue - 1l); TestLong(sw, int.MaxValue); TestLong(sw, int.MaxValue + 1l); TestLong(sw, int.MaxValue + 2l); TestLong(sw, int.MaxValue + 3l); Console.ReadLine(); static void TestLong(Stopwatch sw, long num) { long n = 0; sw.Reset(); sw.Start(); for (long i = 3; i < 20000000; i++) { n += num % i; } sw.Stop(); Console.WriteLine(sw.Elapsed); } EDIT: I now tried the same with C and the issue does not occur here, all modulo operations take the same time, in release and in debug mode with and without optimizations turned on: #include "stdafx.h" #include "time.h" #include "limits.h" static void TestLong(long long num) { long long n = 0; clock_t t = clock(); for (long long i = 3; i < 20000000LL*100; i++) { n += num % i; } printf("%d - %lld\n", clock()-t, n); } int main() { printf("%i %i %i %i\n\n", sizeof (int), sizeof(long), sizeof(long long), sizeof(void*)); TestLong(3); TestLong(10); TestLong(131); TestLong(INT_MAX - 1L); TestLong(UINT_MAX +1LL); TestLong(INT_MAX + 1LL); TestLong(LLONG_MAX-1LL); getchar(); return 0; } EDIT2: Thanks for the great suggestions. I found that both .net and c (in debug as well as in release mode) does't not use atomically cpu instructions to calculate the remainder but they call a function that does. In the c program I could get the name of it which is "_allrem". It also displayed full source comments for this file so I found the information that this algorithm special cases the 32bit divisors instead of dividends which was the case in the .net application. I also found out that the performance of the c program really is only affected by the value of the divisor but not the dividend. Another test showed that the performance of the remainder function in the .net program depends on both the dividend and divisor. BTW: Even simple additions of long long values are calculated by a consecutive add and adc instructions. So even if my processor calls itself 64bit, it really isn't :( EDIT3: I now ran the c app on a windows 7 x64 edition, compiled with visual studio 2010. The funny thing is, the performance behavior stays the same, although now (I checked the assembly source) true 64 bit instructions are used.

    Read the article

  • How to correctly stop thread which is using Control.Invoke

    - by codymanix
    I tried the following (pseudocode) but I always get a deadlock when Iam trying to stop my thread. The problem is that Join() waits for the thread to complete and a pending Invoke() operation is also waiting to complete. How can I solve this? Thread workerThread = new Thread(BackupThreadRunner); volatile bool cancel; // this is the thread worker routine void BackupThreadRunner() { while (!cancel) { DoStuff(); ReportProgress(); } } // main thread void ReportProgress() { if (InvokeRequired) { Invoke(ReportProgress); } UpdateStatusBarAndStuff(); } // main thread void DoCancel() { cancel=true; workerThread.Join(); }

    Read the article

  • What does ZIP stand for (the compression format, not the postal codes)

    - by codymanix
    Does anybody know for what the acronym ZIP stands for which was and is used in programs like PKZIP and GZIP? There is a compression algorithm named Lempel-Ziv-Welch-Algorithm (LZW) maybe the guy named Ziv invented together with other people ZIP? I cannot find anything about it, maybe its not an abbreviation but instead it just means "to zip files" but I think originally there was more about it..

    Read the article

  • Performance problem loading lots of user controls

    - by codymanix
    My application is loading a bunch of the same user control into a ScrollPanel. The problem is, this is very slow. The profiler show that the method Application.LoadComponent(), which is called internally by in the designer code in the constructor of my user control, is the bottleneck. The documentation of this method says, that this method load XAML files. I alway though the compiler compiles XAML to BAML and embedds it into the assembly. So the question is, how can I use BAML instead of XAML? Is there another way to make loading my user controls faster?

    Read the article

1 2  | Next Page >