Jump to content
  • Advertisement

Silence@SiD

Member
  • Content count

    233
  • Joined

  • Last visited

Community Reputation

1009 Excellent

About Silence@SiD

  • Rank
    Member

Personal Information

Social

  • Twitter
    @SilenceAtSid
  • Github
    NoOneIsInnocent

Recent Profile Visitors

4914 profile views
  1. Silence@SiD

    Wormhole Effect

    Xscreensaver has a version of it. I haven't checked if this is 3D or 2D-fake however. There's a video of it here. It is simple but might help you in understanding how this is done.
  2. Silence@SiD

    Normal encoding/decoding

    Atan2(0,0) is defined in C/C++ and its value is 0. However I don't know if that will behave that you would expect it...
  3. But who said the opposite ? Since the begining of this thread some people and I are just strongly suggesting not to use C functions anymore, and to prefer C++ functionalities. Use C functions if you want, they work for sure and std strings are based on C char arrays and some (safe) C functions. Not forcelly. There are some libraries allowing to do and manipulate strings in a more safe manner. Glib is one example. And I'm sure many other exist. And they don't exist just to be beautiful. But no one said that neither ! I have the impression you took it all the wrong way. No one talked about stupidity or that any language is the safest in the world... If you have to repeat a thing 10k times. Will it be safer to use unsafe char arrays, coupled with several unsafe C functions or will it be more safe to use more safe C++ strings with more safe C++ functionalities. That's all about. Take it easy and simple JulieMaru-chan. This is all about giving good tools to use and damn knows this is not an easy thing ! Not to talk about stupidity or language supremacy. For more information: https://social.msdn.microsoft.com/Forums/vstudio/en-US/c678c966-2b25-4ee5-a8de-3835418e2c65/sprintf-depreciated-so-what-do-we-use?forum=vclanguage https://www.gnu.org/software/libc/manual/html_node/Formatted-Output-Functions.html http://spc.cs.ucdavis.edu/index.php/situations/format-string-vulnerabilities
  4. True. Just as plain old C-style casts. And even if C-style casting will most of the time work as expected in C++, this is not something a C++ programmer should reasonably do. In fact, this is not easy in C++ to deprecate language features that exists in C. The only keyword I know which was deprecated is 'register' (in C++ 17). But it has been reserved and this is something C++ specific. Also, we are now in C++ 17. And as other posters pointed it, there are very old functionalities and features in C++ that, if used, will one day or another, reveal bugs, security issues... Unfortunately nothing can prevent anyone to use them, but this is at the author's own and now well known risk. I guess, and to my own opinion, that this is wrong. Why ? C++ (and C) are languages that are not safe by conception. Pointers allow to use the language in dangerous ways. Letting the programmer manages the memory allow that too. Unsafe functions allow it too. And inherently, all common security risks/bugs you are aware of (buffer overflow...) are common security issues in programs written in C (and C++) most of the time due to mistakes when programming (sprintf is a well-known open door to such attacks). And such uses are responsible of the majority of security risks in most of the programs. So yes, these are problematic and should not be used. There are languages that, by design, prevent as most as possible to be used 'badly'. Java and C# are examples of such languages (less for java from what I know). But clearly, system languages as C and C++ are languages that allow to be used in dangerous ways. A simple example of this is that you can do 'hacking' with these languages. C++ protects things a bit more, but then confine to C++. Just as a little example. Imagine you release a game, some kind of MMORPG with let say 100K players. Each player pays every months for playing your game. Each player pays even more to get some upgrades. And now, your programs make the use of sprintf, scanf (and many other well known dangerous functions). Everything is fine until one day a big attack happens on your servers and clients, massively and takes credit card numbers of all your clients... And even if that never happens, doing things well (mainly if you are aware of it), is important, just like you stated for the consistency in your previous post
  5. When you have programs over millions line of code, there is no other choices than the one I suggested. Keeping something deprecated or dangerous will lead to the program to become deprecated, hard to maintain and which will have more bugs. And changing it to something not deprecated and/or more safe, if that's about 2 or 3 calls that's OK. But if it's about to check hundred thousands of files, in several hundreds (or thousands) of locations, no one will accept to do it. That's not about agreement or not.That's just about faisability and risks. Doing it progressively allows to keep new code up to date and revised code also up to date and tested over regressions, security issues, bugs and any concerns one should look at when changing some part of existing code. It also allows to start to do a change. Keeping unsafe functions is, to my own opinion, more bad than to break consistency for the moment you'll do the changes...
  6. This is something very frequent. In companies or organizations, professional softwares or free softwares. Once there is a new way to do a common thing, for sure the old way has to change everywhere. This is why functions exist: limitting code duplication. But the best thing you can do, is to start to change. Also, this does not explain why you are focusing on sprintf. Stringstreams also work with char arrays (just ensure your array will be big enough thought, thus exposing some potential buffer overflow issues...).
  7. Silence@SiD

    Real-Time Rendering, Fourth Edition

    Hi, This book was announced since such a long time. It seems still not released (from amazon.com) or temporarily out of stock (amazon.fr). I was first thinking to buy it and had even made a pre-order. But I canceled it. Mainly because it is not cheap (at least 70€). Also because I had recently bad experiences with products that were giving announces long time before the release. And also because except the PBR and GI part, all the rest seems to be the same as the previous edition (but I only own the second edition). So I would like to know your intents about this book. Will you buy it for sure ? Will you prefer another one ? I actually don't have any books about 3D and real-time rendering which is recent. I guess that the most recent ones are real-time rendering 2nd edition and game programming gems 6... What I'm looking about is/are books about real-time GI mainly (but not only). And not books that are telling what everyone knows or can easily check on the Internet. I'm more interested about things I can learn, things that can give me ideas, things that could be applied in some near future. Thanks for the lecture.
  8. Also since this topic was tagged C++, stringstream should be your prefered friend (and will also expose less security risks). So by doing something like this, you'll end up with the same thing that what you want to do, and in a more elegant fashion: std::stringstream ss; ss << "Risk of hostilities: " << www.ambushRisk[mod][0] << " %"; // use it: std::cout << ss.str() << std::endl;
  9. Silence@SiD

    Good books for learning 3D game programming?

    I believe they can. This also depends on the purpose. If you want to learn. If you want to know... Why not. Just as you are telling after. Here are some books every 3D programmer should have: Computer graphics Principles and practice (the second edition might be enough) Real-time rendering (the third or even second edition might suffice) Interactive computer graphics (same, an older edition will suffice) Also, you'll need a book about the graphics API you'll want to use. And you'll need a book about the full engine design like 3D game engine architecture
  10. Silence@SiD

    glsl - material, texture and light relationship

    In that case you can simply send a uniform. This is small and will be fast enough too. The only issue with this is that you'll have the same color for all your mesh or model. Another solution would be to use a single short integer attribute for the color, and choose the right color by doing a texture lookup from a 1D texture within the shader. Hope that could help.
  11. First thing is to render it well from 'cpu' side. That means, do all your maths calculations on the cpu side (use lib3ds_matrix_identity, lib3ds_matrix_translate_xy and lib3ds_matrix_mult in order to calculate the static positions of the vertices). Once all of this works, this will just be a matter of sending these matrices information to the GPU. One other thing to keep in mind is if you load by nodes (and you should, except if for some reasons the file has no nodes informations) the child node will inherit the coordinate system of its parent.
  12. I haven't followed (neither read) everything, so maybe this was already treated, but you really should use fp framebuffers, otherwise your colors will be clamped to [0..1] as matt77hias said.
  13. Silence@SiD

    glsl - material, texture and light relationship

    I would say, no lights, therefore no materials. So simply use your texture. But if you really want to use a material, then yes, the diffuse one is the one which corresponds the most to what you want to do. However, all of this depends on your materials. And textures are materials. The "default" one is normally the diffuse texture which has to be mixed with the object material, if any. So if your materials (and therefore textures) are made for a lit environment, you might end with something not that beautiful or at least not as expected.
  14. Silence@SiD

    DirectX12 adds a Ray Tracing API

    As a side-node, AMD is telling a lot about real-time raytracing too at that moment. This also remembers me what Imagination did some years ago. But this was not that loudly clamed. And I don't know what happend to this since Apple let them...
  15. Silence@SiD

    Problems with starting out on linux

    I had a radeon HD 4000 series too on a laptop. And to have decent performances I had to install the official ATI drivers. Also disable any compositing so that only your 3D app uses the GPU. I don't know the state on Ubuntu. But if they are not installed by default on this distribution, you'll have to manually install them from here: https://support.amd.com/en-us/download/desktop/legacy?product=Legacy2&os=Linux+x86_64 Also note that you'll most certainly have to downgrade many packages including Xorg, your kernel, your compiler... You'll have to find the equivalent of Debian 7. A quick google search shew that Unity is most certainly working on Linux.
  • Advertisement
×

Important Information

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

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!