Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

380 Neutral

About pseudomarvin

  • Rank

Personal Information

  • Interests
  1. I want to distributy a game I've made as a simple self extracting zip file. After extraction, the structure should look like this: MyGame (shortcut to MyGame/Release/MyGame.exe) MyGame (folder) --- /assets (folder) --- / Release (folder) --- MyGame.exe I have already managed to make the shortcut point to the relative path of MyGame.exe by setting its target as: %windir%\explorer.exe "MyGame\Release\MyGame.exe". But I would also like to set its icon from a file in the assets folder in a relative way so that upon extracting on a different PC, the icon is already set. Is this possible? Or how is it usually done?
  2. I have made a simple 2D game supposed to run on Windows only using SFML. The executable is built using Visual Studio 2017. I would like to make sure that it can run on as many Windows machines as possible (even on Windows 7/8 if possible). What steps can I take to ensure that? I have done the following: Build for Win32 (x86) not x64 platform In Project Properties->C/C++->Code Generation, I set Runtime Library to Multi-threaded (runtime library should thus be statically packed with the exe) not Multi-Threaded DLL Would the following help with compatibility (and not cause problems with forward compatibility)? Using Windows SDK version 8.1? Use older platform toolset (not Visual Studio 2017 v141 but perhaps VS 2015 v140 or even VS 2015 Windows XP) What else can I do, and what should I be aware of? Thanks.
  3. To clarify, I'm working on IBL for Physically Based Rendering and I wanted to implement a slow and dumb brute force way of solving the integral in the reflectance equation before doing it the optimized way but I found I couldn't. It was really just for reference to see if I get things right. @Hodgman It fails on SDL_GL_SwapWindow. Curiously not after the first frame but always after the second. @WiredCat I've tried using double instead of float and also increased the size of the incremented value. Still crashes. It is of course just sample code @Scouting Ninja Well it builds ok. It seems that the reason is as far as I can tell not related to the size of the shader program on the GPU. # Crashes for (double x = 0; x < 100; x += 1.0) { for (double y = 0; y < 100; y += 1.0) { sum += 1.0; } } # Works for (int x = 0; x < 10000; x += 1) { for (int y = 0; y < 10000; y += 1) { sum += 1.0; } } Thanks guys, it's not necessarily a mystery that I need to solve, I was just curious what the hard limit is and whether there's a way to go around it.
  4. I assumed that if a shader is computationally expensive then the execution is just slower. But running the following GLSL FS instead just crashes void main() { float x = 0; float y = 0; int sum = 0; for (float x = 0; x < 10; x += 0.00005) { for (float y = 0; y < 10; y += 0.00005) { sum++; } } fragColor = vec4(1, 1, 1 , 1.0); } with unhandled exception in nvoglv32.dll. Are there any hard limits on the number of steps/time that a shader can take before it is shut down? I was thinking about implementing some time intensive computation in shaders where it would take on the order of seconds to compute a frame, is that possible? Thanks.
  5. All right, thanks again for the input :).
  6. Thank you all for the thoughtful comments, they've been very helpful. @Alberth: For practical reasons it would probably be best to let the user decide as you say, I just wanted to know what some reasonable values are. @frob: It is indeed a CS homework problem  :D. If I use a single byte there is an upper limit of 2^8 = 256 codes that I would require at most. Theoretically, if I use 64 bits as the size of a symbol I would have to (in the worst case) assign 2^64 codes. I guess that this is not really a problem if I only assign codes to 64b strings that actually occurred in the data (the cardinality of that subset of all possible 64b strings will be much smaller). Am I correct in that?
  7. I am tasked with implementing three different compression methods: arithmetic coding, PPM and LZW. I then have to compare their performance on different data (image, audio, text, binary executables). If the compression program receives a file on input and does not know what the contents are, how do I choose the appropriate symbol size? E.g., if the file is text, a single character could be 8 or 16 bit long and setting symbol size to 8 bits or 16 bits could have large impact on the compression ratio. Do I simply try various reasonable sizes (various multiples of one byte) and see which one fits the data best?
  8. pseudomarvin

    Phong model correctness (video)

    Great, thanks for explanation.
  9. pseudomarvin

    Phong model correctness (video)

    Yep, that solved it. Is there a physics/optics rationale for doing that? Thanks.
  10. Do you guys think this implementation of Phong shading and Phong reflection model is correct?   I use a directionial light pointing exactly where the black line is heading (0, 0, -1). I modify the shininess value later in the video.  I especially find it strange that when I look in direction exactly opposite to light, the contours of the bunny start glowing (if the shininess factor is low enough). But I have compared my implementation to a reference from our graphics class and it did the same thing.     Code: // Calculation is performed in world space vec3 N = normalize(worldNormal); vec3 specColor = vec3(1.0f, 1.0f, 1.0f); float ambient = 0.2f; float NLdot = max(dot(-U::worldLightDirection, N), 0.0f); float diffuse = NLdot; vec3 V = normalize(U::worldCameraPosition - worldPos); vec3 R = normalize(glm::reflect(U::worldLightDirection, N)); float specular = pow(max(dot(R, V), 0.0f), U::shininess); vec3 shadedColor = (ambient + diffuse) * albedo + specular * specColor;
  11. pseudomarvin

    Mipmapping for a SW renderer

    Thanks everyone for the suggestions.
  12. pseudomarvin

    Mipmapping for a SW renderer

    So the mipmap index calculation would look like this:   1) Calculate the interpolated texture coordinates for the 4 pixels. 2) Calculate the the largest du, dv for the top left pixel: // (x,y) are current pixel coords float duDx = pixel(x+1, y).u - pixel(x,y).u; float dvDx = pixel(x+1, y).v - pixel(x,y).v; float duDy = pixel(x, y+1).u - pixel(x,y).u; float dvDy = pixel(x, y+1).v - pixel(x,y).v; // choose max from these to calculate mipmap index 3) Now do I also use the index calculated for the topleft pixel as the index for the other 3 pixels?
  13. I am writing a sofware renderer. I have no SIMD or multithreading functionality yet. When rasterizing a triangle I loop over all of the pixels in its bounding box (in screen coordinates) and interpolate and color the pixels that pass the edge function. I tried implementing mipmapping but found that to compute the texture coordinate differentials I needed the interpolated values for the right and bottom neighboring pixels (whose attributes are not interpolated at this point).   I thought of couple solutions: 1) Do another loop before the main one which would just calculate all of the interpolated texture coordinates so they are available in the main loop. (This is obviously slow) 2) Choose the right mip level of the texture by calculating the maximum differential from the 3 vertices of the rasterized triangle. Would this work?      Intuitively it seems to me that yes: consider two vertices, u1 = 0, u2 = 1 and in screen coordinates x1 = 100, x2 = 600. Then it makes sense to pick a larger texture. On the other hand if u1 = 0 and u2 = 0 and x1= 100, x2 = 101, then picking the      smallest texture sounds reasonable.   Would these solutions work and/or is there a better one?
  14. Yeah, thanks. I guess I use a guard band (clamp the raster space coordinates to 0, width -1 or height - 1) and use Floating Point arithmetic so actually an infinite guard band.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!