投稿時間:2022-08-29 02:05:59 RSSフィード2022-08-29 02:00 分まとめ(7件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
js JavaScriptタグが付けられた新着投稿 - Qiita 【React Native】Firebaseインストール後に/node_modules/idb/build/index.cjs`. Indeed, none of these files exist: https://qiita.com/shiho97797/items/fa1b64695f27ed56a66d firebasereactreactnative 2022-08-29 01:20:57
海外TECH DEV Community Fly.io, alternativa ao Heroku https://dev.to/booscaaa/flyio-alternativa-ao-heroku-35mj Fly io alternativa ao HerokuNo dia chegou o e mail que o heroku vai remover alguns serviços gratuitos láem novembro Se vocêassim como eu usava muito ele para hospedar alguns testes soluções do seu github e atémesmo algumas brincadeiras Fly io pode ser uma solução incrível substituindo o heroku Como migrar seus appsVeremos um passo a passo para realizar a migração tanto da aplicação quanto das esteiras de deploy no github actions InstalaçãoCrie uma conta em fly ioBaixe e instale o SDK fornecido linuxcurl L sh macbrew install flyctl windowsiwr useb iexFaça o login com o SDKfly auth login DeployNa pasta raiz do seu projeto rodefly launch siga os passos de configuração necessáriosUm arquivo chamado fly toml serácriado na raiz do projeto Altere a porta da aplicação services http checks internal port porta da sua aplicação aqui processes app protocol tcp Por fim rodefly launch orfly deployAcesse o link disponibilizado no fly io e seu app estarádisponível Github actionsAltere o arquivo de workflow do seu app Remova tudo referente ao Heroku Adicione no arquivo deploy yaml env FLY API TOKEN secrets FLY API TOKEN No seu job uses superfly flyctl actions setup flyctl master run flyctl deploy remote only detach Exemploname Deploy to fly io appon create tags v env FLY API TOKEN secrets FLY API TOKEN jobs build runs on ubuntu latest steps uses actions checkout v name Config file access run rm rf config json touch config json json database url DB USER DB PASS DB HOST DB PORT server port echo json gt config json sed i e s DB PORT secrets DB PORT g config json sed i e s DB USER secrets DB USER g config json sed i e s DB PASS secrets DB PASS g config json sed i e s DB HOST secrets DB HOST g config json cat config json uses superfly flyctl actions setup flyctl master run flyctl deploy remote only detach Feito com isso seu app jáestádisponível gratuitamente para uso da mesma forma que fazíamos no heroku 2022-08-28 16:38:37
海外TECH DEV Community Learn OpenGL with Rust: shaders https://dev.to/samkevich/learn-opengl-with-rust-shaders-28i3 Learn OpenGL with Rust shadersWelcome to the second part of Learn OpenGL with Rust tutorial In the last article we learned a bit of OpenGL theory and discovered how to create a window initialize OpenGL context and call some basic api to clear a window with a color of our choice In this article we ll briefly discuss modern OpenGL graphics pipeline and how to configure it using shaders All the source code for the article you can find on my github Graphics pipelineWe consider screen of the devise as a D array of pixels but usually we want to draw objects in D space so a large part of OpenGL s work is about transforming D coordinates to D pixels that fit on a screen The process of transforming D coordinates to D pixels is managed by the graphics pipeline The graphics pipeline can be divided into several steps where each step requires the output of the previous step as its input All of these steps have their own specific function and can be executed in parallel Each step of the pipeline runs small programs on the GPU called shader As input to the graphics pipeline we pass vertices list of points from which shapes like triangles will be constructed later Each of these points is stored with certain attributes and it s up to programmer to decide what kind of attributes they want to store Commonly used attributes are D position and color value The first part of the pipeline is the vertex shader that takes as input a single vertex The main purpose of the vertex shader is transformation of D coordinates It also passes important attributes like color and texture coordinates further down the pipeline The primitive assembly stage takes as input all the vertices from the vertex shader and assembles all the points into a primitive shape The output of the primitive assembly stage is passed to the geometry shader The geometry shader takes the primitives from the previous stage as input and can either pass a primitive down to the rest of the pipeline modify it completely discard or even replace it with other primitives After that final list of shapes is composed and converted to screen coordinates the rasterization stage turns the visible parts of the shapes into pixel sized fragments The main purpose of the fragment shader is to calculate the final color of a pixel In more advanced scenarios there could also be calculations related to lighting and shadowing and special effects in this program Finally the end result is composed from all these shape fragments by blending them together and performing depth and stencil testing So even if a pixel output color is calculated in the fragment shader the final pixel color could still be something different when rendering multiple triangles one over another The graphics pipeline is quite complex and contains many configurable parts In modern OpenGL we are required to define at least a vertex and fragment shader geometry shader is optional ShadersAs discussed earlier in modern OpenGL it s up to us to instruct the graphics card what to do with the data And we can do it writing shader programs We will configure two very simple shaders to render our first triangle Shaders are written in a C style language called GLSL OpenGL Shading Language OpenGL will compile your program from source at runtime and copy it to the graphics card Below you can find the source code of a vertex shader in GLSL version in vec position in vec color out vec vertexColor void main gl Position vec position vertexColor color Each shader begins with a declaration of its version Since OpenGL and higher the version numbers of GLSL match the version of OpenGL Next we declare all the input vertex attributes in the vertex shader with the in keyword We have two vertex attributes one for vertex position and another one for vertex color Apart from the regular C types GLSL has built in vector and matrix types vec and mat with a number at the end which stands for number of components The final position of the vertex is assigned to the special gl Position variable The output from the vertex shader is interpolated over all the pixels on the screen covered by a primitive These pixels are called fragments and this is what the fragment shader operates on The fragment shader only requires one output variable and that is a vector of size that defines the final color output FragColor in our case Here is an example of our simple fragment shader version out vec FragColor in vec vertexColor void main FragColor vec vertexColor Shader can specify inputs and outputs using in and out keywords If we want to send data from one shader to another we have to declare an output in the first shader and a similar input in the second shader OpenGL will link those variables together and send data between shaders In our case we pass vertexColor from vertex shader to the fragment shader This value will be interpolated among all the fragments of our triangle In order for OpenGL to use the shader it has to dynamically compile it at run time from a source code But first we declare shader struct which will store shader object id pub struct Shader pub id GLuint To create an object we will use gl CreateShader function which takes type of shader gl VERTEX SHADER or gl FRAGMENT SHADER as a first argument Then we attach the shader source code to the shader object and compile the shader let source code CString new source code let shader Self id gl CreateShader shader type gl ShaderSource shader id amp source code as ptr ptr null gl CompileShader shader id To check if compilation was successful and to retrieving the compile log we can use gl GetShaderiv and gl GetShaderInfoLog accordingly The final version of shader creation function looks like this impl Shader pub unsafe fn new source code amp str shader type GLenum gt Result lt Self ShaderError gt let source code CString new source code let shader Self id gl CreateShader shader type gl ShaderSource shader id amp source code as ptr ptr null gl CompileShader shader id check for shader compilation errors let mut success GLint gl GetShaderiv shader id gl COMPILE STATUS amp mut success if success Ok shader else let mut error log size GLint gl GetShaderiv shader id gl INFO LOG LENGTH amp mut error log size let mut error log Vec lt u gt Vec with capacity error log size as usize gl GetShaderInfoLog shader id error log size amp mut error log size error log as mut ptr as mut error log set len error log size as usize let log String from utf error log Err ShaderError CompilationError log To delete a shader once we don t need it anymore we implement trait Drop and will call gl DeleteShader function with shader id as an argument impl Drop for Shader fn drop amp mut self unsafe gl DeleteShader self id Shader programSo far vertex and fragment shaders have been two separate objects We will use shader program to link them together When linking the shaders into a program it links the outputs of each shader to the inputs of the next shader Hence we can have program linking errors if outputs and inputs do not match Similar to Shader we will declare Program struct which holds program id generated by gl CreateProgram function To link all shaders together we need to attach them first with gl AttachShader and then use gl LinkProgram for linking Like with shaders we can check for and retrieve linking errors if we have any pub struct ShaderProgram pub id GLuint impl ShaderProgram pub unsafe fn new shaders amp Shader gt Result lt Self ShaderError gt let program Self id gl CreateProgram for shader in shaders gl AttachShader program id shader id gl LinkProgram program id let mut success GLint gl GetProgramiv program id gl LINK STATUS amp mut success if success Ok program else let mut error log size GLint gl GetProgramiv program id gl INFO LOG LENGTH amp mut error log size let mut error log Vec lt u gt Vec with capacity error log size as usize gl GetProgramInfoLog program id error log size amp mut error log size error log as mut ptr as mut error log set len error log size as usize let log String from utf error log Err ShaderError LinkingError log To prevent resources liking we implement Drop trait for shader program as well impl Drop for ShaderProgram fn drop amp mut self unsafe gl DeleteProgram self id Finally we can use our declared types to compile shaders and link them into a program which we will use during rendering let vertex shader Shader new VERTEX SHADER SOURCE gl VERTEX SHADER let fragment shader Shader new FRAGMENT SHADER SOURCE gl FRAGMENT SHADER let program ShaderProgram new amp vertex shader fragment shader To use the program while rendering we declare function apply for Program type that uses gl UseProgram under the hood pub unsafe fn apply amp self gl UseProgram self id Every rendering call after apply will use this program object SummaryToday we ve learned how graphics pipeline of modern OpenGL works and how we can use shaders to configure it Next time we are going to lean what vertex buffer and vertex array objects are and how we can use knowledge we ve got so far to render a first triangle If you find the article interesting consider hit the like button and subscribe for updates 2022-08-28 16:18:59
金融 ◇◇ 保険デイリーニュース ◇◇(損保担当者必携!) 保険デイリーニュース(08/29) http://www.yanaharu.com/ins/?p=5013 jeplan 2022-08-28 16:23:09
ニュース ジェトロ ビジネスニュース(通商弘報) 気候変動対策の進捗を評価する新システムSIATを導入 https://www.jetro.go.jp/biznews/2022/08/482f456ca30e6dd7.html 気候変動 2022-08-28 16:10:00
ニュース ジェトロ ビジネスニュース(通商弘報) 山東省、RCEP協定利用の輸入の6割が韓国から https://www.jetro.go.jp/biznews/2022/08/4d7f02723d6af874.html 輸入 2022-08-28 16:05:00
ニュース BBC News - Home Super League: Hull FC 38-12 Toulouse Olympique - hosts score seven tries in dominant win https://www.bbc.co.uk/sport/rugby-league/62660722?at_medium=RSS&at_campaign=KARANGA toulouse 2022-08-28 16:19:18

コメント

このブログの人気の投稿

投稿時間:2021-06-17 22:08:45 RSSフィード2021-06-17 22:00 分まとめ(2089件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)