نمایش نتایج 1 تا 3 از 3

نام تاپیک: مقایسه OpenGL , Vulkan , SFML

  1. #1
    کاربر دائمی آواتار amin1softco
    تاریخ عضویت
    شهریور 1386
    محل زندگی
    پای آن سرو بلند
    پست
    1,832

    مقایسه OpenGL , Vulkan , SFML

    گفتم یک نگاهی به یاد قدیما بندازم به منابع گرافیک رایانه ایی که دیدم خیلی از چیزای جدید ارائه شده گفتم بزار اینا رو یک نگاهی بهشون بندازیم ببینیم قضیه چیه پس بزارید یک یک یک خلاصه ایی ازشون بگذاریم شما هم نظرتون را بدید :

    SFML (Simple and Fast Multimedia Library) is a cross-platform software development library designed to provide a simple and intuitive interface for developers to create multimedia applications, such as games, animations, and interactive visualizations.

    SFML provides a variety of features, including window creation and management, audio and video playback, input handling, graphics rendering, networking, and threading. It is written in C++‎ and supports several programming languages, including C, Python, and Java.

    One of the key advantages of SFML is its ease of use. It has a well-designed and documented API, with a simple and intuitive interface that makes it easy for developers to create multimedia applications. It also has a large and active community of users and contributors, who provide support, documentation, and tutorials.

    SFML is open source and can be used free of charge for commercial and non-commercial projects. It is compatible with a wide range of platforms, including Windows, Linux, macOS, iOS, and Android, making it an ideal choice for developers looking to create cross-platform applications
    Games that use SFML:

    SuperTuxKart by the SuperTuxKart Team
    Desktop Dungeons by QCF Design
    Alone in the Dark: Illumination by Pure FPS
    Radiant by Hexage
    Tiled by Thorbjørn Lindeijer (a level editor used for many games)


    و کتابخانه Vulkan



    Vulkan is a low-level, cross-platform 3D graphics and compute API (Application Programming Interface) developed by the Khronos Group. It provides developers with a more direct and efficient way to access graphics hardware, enabling high-performance graphics and compute applications to be developed for a wide range of platforms, including Windows, Linux, Android, and other operating systems.

    Compared to its predecessor, OpenGL, Vulkan is designed to be more scalable and efficient by reducing CPU overhead and enabling better parallelism. This allows developers to achieve higher performance and more efficient use of hardware resources, which is particularly important for complex applications such as games and virtual reality.

    Vulkan provides a wide range of features, including advanced memory management, multi-threaded command submission, support for multiple GPUs, and support for the latest graphics technologies such as tessellation and ray tracing. It also provides a high degree of flexibility, allowing developers to fine-tune performance and optimize their applications for different hardware configurations.

    Games that use Vulkan:

    DOOM (2016) and DOOM Eternal by id Software
    Wolfenstein II: The New Colossus by MachineGames
    Dota 2 by Valve Corporation
    Tom Clancy's Rainbow Six Siege by Ubisoft Montreal
    Talos Principle by Croteam



    و در آخر OpenGL

    OpenGL (Open Graphics Library) is a cross-platform 3D graphics API (Application Programming Interface) used for rendering 2D and 3D vector graphics. It was first introduced in 1992 by Silicon Graphics, Inc. (SGI) and has since become the industry standard for 3D graphics programming.

    OpenGL provides a set of functions and procedures that allow developers to specify the objects and operations needed to render 2D and 3D graphics on a variety of hardware platforms. It is widely used in a range of applications, including video games, computer-aided design (CAD), scientific visualization, and virtual reality.

    OpenGL is supported on a variety of platforms, including Windows, macOS, Linux, and mobile platforms such as iOS and Android. It provides a high degree of flexibility and can be used with a variety of programming languages, including C, C++‎, Java, Python, and more.

    OpenGL is constantly evolving, with new features and improvements being added to the API on a regular basis. In recent years, newer graphics APIs such as Vulkan have emerged, but OpenGL remains a widely used and important tool for 3D graphics programming.

    Minecraft by Mojang Studios
    Counter-Strike: Global Offensive by Valve Corporation
    World of Warcraft by Blizzard Entertainment
    Team Fortress 2 by Valve Corporation
    Portal by Valve Corporation
    Half-Life 2 by Valve Corporation
    The Elder Scrolls V: Skyrim by Bethesda Game Studios
    Grand Theft Auto V by Rockstar North

  2. #2
    کاربر دائمی آواتار amin1softco
    تاریخ عضویت
    شهریور 1386
    محل زندگی
    پای آن سرو بلند
    پست
    1,832

    نقل قول: مقایسه OpenGL , Vulkan , SFML

    برای چک کردن کد های این کتابخانه های بهتره یک نگاهی به جیت هاب این کتاب داشته باشید
    https://github.com/PacktPublishing/C...ent-By-Example
    برای هر سه مورد یک مثال داره و به نظرم کتاب خوبیه برای چک کردن یک مثال عملیاتی از این 3 کتابخانه
    https://www.amazon.com/Game-Developm.../dp/1789535301
    برای دانلود کتابش همین OpenGL_books را در تلگرام سرچ کنید می تونید پیداش کنید به شکل pdf

  3. #3
    کاربر دائمی آواتار amin1softco
    تاریخ عضویت
    شهریور 1386
    محل زندگی
    پای آن سرو بلند
    پست
    1,832

    نقل قول: مقایسه OpenGL , Vulkan , SFML

    حالا سوالی که مطرح می شه در بین زبان هایی که برای نوشتن شیدر های گرافیکی توسعه داده شدن چندتاش را می شه در vulkan استفاده کرد ؟

    GLSL (OpenGL Shading Language) - used for shaders in OpenGL and WebGL
    HLSL (High-Level Shading Language) - used for shaders in Microsoft DirectX
    SPIR-V (Standard Portable Intermediate Representation) - a binary format that can be used for shaders in Vulkan, OpenGL, and OpenCL
    Metal Shading Language - used for shaders in Apple's Metal graphics API
    Cg (C for Graphics) - a shading language developed by Nvidia for use with their graphics hardware
    RenderScript - a shading language used for compute kernels in Android's RenderScript API
    Sh - a shading language used for ray tracing in the Nvidia OptiX ray tracing engine


    و حالا در vulkan

    Shaders in Vulkan are written in the SPIR-V language, which is a binary format that can be generated by a variety of shader compilers. You can write shaders directly in SPIR-V, or you can write them in another language such as GLSL or HLSL and then compile them to SPIR-V.

    To use shaders in Vulkan, you will need to create a pipeline that specifies the shader stages (vertex shader, tessellation control shader, tessellation evaluation shader, geometry shader, fragment shader, compute shader) and the input and output data for each stage. The pipeline can then be bound to a command buffer and executed on the GPU.

    Vulkan provides a number of tools and libraries for working with shaders, including the Vulkan SDK, the SPIR-V Tools library, and the glslang compiler.





    حالا بیایید یک نگاهی به کدهای شیدرهای مختلف در زبان های مختلف داشته باشیم


    #version 330 core

    uniform float time;
    uniform vec2 resolution;

    void main()
    {
    vec2 uv = (gl_FragCoord.xy / resolution.xy) * 2.0 - 1.0;
    float t = time * 0.5;
    float wave1 = sin(uv.x * 20.0 + t) * 0.2;
    float wave2 = sin(uv.y * 20.0 + t) * 0.2;
    gl_FragColor = vec4(0.5 + wave1 + wave2, 0.5 + wave1, 0.5 + wave2, 1.0);
    }




    HLSL:



    float2 main(float2 uv : TEXCOORD) : SV_Target
    {
    float t = _Time.y * 0.5;
    float wave1 = sin(uv.x * 20.0 + t) * 0.2;
    float wave2 = sin(uv.y * 20.0 + t) * 0.2;
    return float4(0.5 + wave1 + wave2, 0.5 + wave1, 0.5 + wave2, 1.0);
    }




    Metal Shading Language:



    #include <metal_stdlib>

    using namespace metal;

    struct VertexIn {
    float2 position [[attribute(0)]];
    };

    struct VertexOut {
    float2 texCoord [[user(locn0)]];
    };

    vertex VertexOut vertexShader(VertexIn vertexIn [[stage_in]]) {
    VertexOut vertexOut;
    vertexOut.texCoord = vertexIn.position;
    return vertexOut;
    }

    fragment float4 fragmentShader(VertexOut vertexOut [[stage_in]],
    constant float& time [[buffer(0)]],
    constant float2& resolution [[buffer(1)]]) {
    float2 uv = (vertexOut.texCoord / resolution) * 2.0 - 1.0;
    float t = time * 0.5;
    float wave1 = sin(uv.x * 20.0 + t) * 0.2;
    float wave2 = sin(uv.y * 20.0 + t) * 0.2;
    return float4(0.5 + wave1 + wave2, 0
    .5 + wave1, 0.5 + wave2, 1.0);
    }



    Cg:


    struct VertexInput {
    float2 position : POSITION;
    };

    struct VertexOutput {
    float2 texCoord : TEXCOORD0;
    };

    VertexOutput vertexShader(VertexInput input) {
    VertexOutput output;
    output.texCoord = input.position;
    return output;
    }

    float4 fragmentShader(VertexOutput input,
    uniform float time,
    uniform float2 resolution) : COLOR {
    float2 uv = (input.texCoord / resolution) * 2.0 - 1.0;
    float t = time * 0.5;
    float wave1 = sin(uv.x * 20.0 + t) * 0.2;
    float wave2 = sin(uv.y * 20.0 + t) * 0.2;
    return float4(0.5 + wave1 + wave2, 0.5 + wave1, 0.5 + wave2, 1.0);
    }




    RenderScript:




    #pragma version(1)
    #pragma rs_fp_relaxed

    float2 __attribute__((kernel)) wave(float2 in, uint32_t x, uint32_t y) {
    float2 uv = in * 2.0 - 1.0;
    float t = rsGetElementAt_float(g_time, 1) * 0.5;
    float wave1 = sin(uv.x * 20.0 + t) * 0.2;
    float wave2 = sin(uv.y * 20.0 + t) * 0.2;
    return float2(0.5 + wave1 + wave2, 0.5 + wave1);
    }




    خوب این سری ویدئو ها هم برای vulkan جالبه
    https://www.youtube.com/watch?v=Y9U9IE0gVHA&list=PL8327DO66nu9qYVKLDmdLW_8 4-yE4auCR




    اگر به این خط تولید هم یک نگاهی بندازید اول پردازنده میاد رئوس و فضای کلی را می سازه و شما اول شیدر های ورتکستون اعمال می شه و در آخر روی پیکسل های نهای شیدر فرگمنت (یا پیکسل در HLSL دایرکس)
    آخرین ویرایش به وسیله amin1softco : سه شنبه 09 اسفند 1401 در 14:23 عصر

تاپیک های مشابه

  1. سوال: Allegro OR OpenGL OR SDL OR SFML ؟
    نوشته شده توسط moonDark در بخش برنامه نویسی با زبان C و ++C
    پاسخ: 5
    آخرین پست: دوشنبه 07 اردیبهشت 1394, 20:55 عصر
  2. مقایسه سرعت DX و OpenGL در C#‎ و C++‎
    نوشته شده توسط benyamin_pc در بخش طراحی و ساخت بازی‌های کامپیوتری
    پاسخ: 36
    آخرین پست: یک شنبه 19 آبان 1387, 19:32 عصر
  3. مقا یسه ی OpenGL و DirectX
    نوشته شده توسط Vahid_Nasiri در بخش طراحی و ساخت بازی‌های کامپیوتری
    پاسخ: 4
    آخرین پست: دوشنبه 27 اسفند 1386, 15:43 عصر
  4. مقایسه ی کارت های گرافیکی موجود در ایران از دیدگاه OpenGL
    نوشته شده توسط Vahid_Nasiri در بخش طراحی و ساخت بازی‌های کامپیوتری
    پاسخ: 2
    آخرین پست: شنبه 03 آبان 1382, 17:54 عصر

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •