Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
34 views

How do I repeatedly change the colors of a list of cubes in run time without causing a bottleneck to my fluid simulation?

I am coding a 3d fluid simulation. I want to render each cell of the simulation grid with a cube, so I have a grid of cubes. Each cube has its own color, and the colors are stored in a compute buffer. ...
Mohamad T Shehab's user avatar
0 votes
0 answers
46 views

How to implement graphics API functions like setUniform on a cross-platform shader in VLang?

I've been working on a C++ game engine for a while, but I decided to scrap the project because doing it in C++, despite my best efforts, I could feel the technical dept building. As such, I switched ...
Spencer Rosas-Gunn's user avatar
0 votes
1 answer
94 views

How to get the direction to the sky a pixel is facing to draw a sky?

I am drawing an empty texture over a framebuffer with a fragment shader active to try and draw a sky, but I need the direction each pixel is facing in (for correct linear perspective) to draw the ...
Tachytaenius's user avatar
0 votes
1 answer
210 views

Shader to give the effect of a 2D character covered in oil

I have a 2D pixel art game where characters can be covered in a flammable black oil-like substance and I am looking for a simple way to depict that visually. Simply tinting the character black won't ...
Martin's user avatar
  • 43
0 votes
1 answer
314 views

Animating A 2D Stylized Cloud Programmatically

I am tiling the following background cloud image horizontally. I would like to give it more character by making the top of the image deform. I would preferably like the puffs on top to bulge bigger ...
PayasoPrince's user avatar
3 votes
0 answers
91 views

Smooth self shadow on dense foliage

I don't know how to achieve or research smooth lighting on foliage, like in this screenshot of theHunter: Call of the Wild. The grass is translucent, but blocks light smoothly when it's tall and ...
Cebbi's user avatar
  • 201
0 votes
1 answer
48 views

Object stuck to screen no matter what eye position is used

I've run into an issue when trying to write a simple rendering program in D3D11. I'm 90% sure it's to do with some faulty matrix multiplication or generation, but I've tried debugging the values of ...
vK 3 1 RON's user avatar
0 votes
1 answer
259 views

Unity Shader - Moving one texture around and on top of another texture

I have a shader that applies a texture to a sphere with lighting, making it look like a nicely lit planet: The code for my shader is here: ...
Cato's user avatar
  • 103
0 votes
1 answer
138 views

How to emulate the look of loading ZX Spectrum title screens in Unity

I am looking to replicate the style of screen loading as seen on the ZX Spectrum in Unity. Not the stripes of colors in the background. Just the title image loading. Specifically the way it looks in ...
Logan Grocholski's user avatar
1 vote
1 answer
286 views

Screen space reflections bug

I try to implement screen space reflections in my graphics engine using ray marching algorithm. After a lot of trying I got this result: https://youtu.be/yzkgpcliBVQ As you can see, the reflections ...
Алексей Карамбович's user avatar
1 vote
1 answer
891 views

Unity: Alpha and color issues with opaque projector/decal shader

I have been attempting to make a simple "overwrite" version of Unity's projector shader. I can either respect the color, or respect the transparency, but not both. I have simplified the ...
Zoop's user avatar
  • 161
1 vote
0 answers
487 views

Line of sight shader

Strategy games (such as Door Kickers) use a player's unit's line-of-sight as a major game feature. To provide feedback to the player regarding which areas are in view and which are not, different ...
DrMcCleod's user avatar
  • 111
1 vote
0 answers
103 views

GLSL link fails with C9999 (too many buffer declarations?)

I'm receiving a C9999 (*** exception during compilation ***) linker error for an OpenGl 4.6 compute shader. It seems to be related to the number of SSBOs I have declared (14 separate declarations), ...
gdevi's user avatar
  • 11
1 vote
2 answers
963 views

How can I draw orbit paths for a solar system?

I’m trying to make the orbital paths visible for my solar system simulation game. I have most around with trail renderers and solid line sprite but not achieving the desired look I want. I’m hoping to ...
Jeremy's user avatar
  • 15
0 votes
1 answer
84 views

Ocean visible through the island's lake in Unity3D?

I'm working on a puzzle game featuring islands: there is a plane with a water shader, and objects colliding with that plane. Now I'd like to make lakes on the islands, with different (higher) water ...
Tudvari's user avatar
  • 771
0 votes
3 answers
330 views

weird behaviour doing simple XMMATRIX multiplications

I have the following function: ...
rekotc's user avatar
  • 163
0 votes
0 answers
221 views

Show the edges between the clipping plane and clipped objects

I want to utilize shaders to not only discard fragments if they are on one side of a predefined plane but also render a contour along the intersection. My fragment shader currently does something ...
graphics_guy's user avatar
3 votes
1 answer
498 views

Planet Surface Rendering: Precision issues [duplicate]

I have been experimenting with C++ and OpenGL, and I am currently writing a program that renders the surface of a planet; specifically, our moon. It's a modified version of the GPU Gems implementation ...
RedRuin's user avatar
  • 31
1 vote
1 answer
444 views

How to access Lit shader properties through code?

Currently i'm using HDRP in my project, so i have a question. How can i access Lit shader properties through code ? Or where i can see names of variables in this shader ? For example:
Areyana's user avatar
  • 156
0 votes
0 answers
330 views

Cascading Shadow Maps - Spotlight Projection

In all the cascading shadow map explanations I have read, the final projection into the shadow-map is done using an orthographic projection. This makes sense for a directional light because a ...
Zwander's user avatar
  • 175
1 vote
1 answer
1k views

Does it make sense to do more calculations in the fragment shader if there are more vertices than pixels?

I'm very new to graphics programming, and as I understand it vertex shaders are called per vertex and fragment shaders are per pixel (ignoring anti-aliasing). When it comes to optimization all sources ...
ragemagic's user avatar
1 vote
1 answer
2k views

Surface Depth Intersection Shader

I recently asked a question about the creating an accurate Depth Intersection Shader. When creating this in a fragment / vertex shader it could be achieved by the following code ...
Dan's user avatar
  • 185
3 votes
1 answer
8k views

Depth Intersection Shader

I am trying to create a shader in Unity that shows where intersections occur between objects. Most of the shader I have so far is based off of this youtube tutorial. However, I have made some slight ...
Dan's user avatar
  • 185
2 votes
2 answers
4k views

Getting scene normals in Unity

When I get the depthnormals with the shaderreplace script, it just replaces all the shaders in the scene and uses the meshes geometry to calculate the normals, ignoring the normalmap textures applied ...
Cactus on Fire's user avatar
2 votes
1 answer
2k views

One Giant Shader VS Many Small Shaders

I am building forward rendering engine combined with atlas shadow map technique. My goal is to build an engine that is capable of rendering similar scenes from games such as.. Doom Overwatch So I ...
Blue Bug's user avatar
  • 1,112
1 vote
1 answer
3k views

Can't Unity draw fine and smooth line?

I'm working on drawing lines in Unity, but find there is no way to draw clear, fine and smooth line in Unity, neither ...
Suge's user avatar
  • 141
0 votes
1 answer
135 views

Direct3D 11 : Pixel shader and Vertex shader getting set at every draw call

I'm working on my own (much tinier) version of Monogame. Right now I've been able to draw triangles to the screen with custom shaders using Direct3D 11. The problem is that I can't get it to be as ...
wingmanx7's user avatar
1 vote
1 answer
68 views

Fragment shader working so strange

the fragment shader is working so strange, can someone explain me whats going on. this one compiles fine but crashes when i use it- ...
VersesDev's user avatar
2 votes
1 answer
445 views

How to achieve "concept art" graphics?

I'm currently working on a 3D Game and I want a unique graphic style. Concept Arts have a cool "painted" look. You can clearly see that this picture is painted on a graphic tablet. (https://i.sstatic....
null's user avatar
  • 191
0 votes
1 answer
388 views

Depth test -opengl

Does depth test runs before fragment shader,hence not even processing the fragment with frag shader if fragment is discarded Or It first runs the fragment shader and then depth test I.e. fragment ...
VersesDev's user avatar
1 vote
1 answer
754 views

Metaballs created through raycasting in fragment shader - billboards are still recognizable

Good day everyone, I'm currently programming a fluid simulation through use of metaballs and I have a very specific problem/question. The steps I use for metaball simulation: 1. Simulate particles' ...
Grougal's user avatar
  • 31
2 votes
1 answer
2k views

How to make far block graphically better?

What calcules can I do to make far objects looking better? My game Here's what I see if I go back with the camera in my test-rendering scene: As you can see the result is not one of the bests: ...
loryruta's user avatar
0 votes
1 answer
345 views

BRDF Incorrect specular highlights

I'm currently attempting to implement BRDF lighting, and am hitting a bit of a snag with my specular term - the specular highlights aren't rendering correctly. To make things simple, I'm using a ...
Yattabyte's user avatar
  • 1,033
0 votes
2 answers
201 views

Having problems sending multiple lights to my shader

I have a lightstruct in C++ which holds the color and direction of the light. ...
Wouter de Vries's user avatar
2 votes
5 answers
538 views

Approximating particles with with nebula

I have a 2d galaxy where each star is rendered a particle: I'd like to approximate it with nebula, so that instead of seeing lots of tiny dots from afar, users will see lots smooth light in the area. ...
Anvaka's user avatar
  • 295
2 votes
1 answer
637 views

Disney BRDF - where is metallic factor input into BRDF?

Burley states about metallic parameter: "This is a linear blend between two different models. ..." What are the two models? I can't see this described in the Frostbite or the Unreal papers either. ...
Justicle's user avatar
  • 712
1 vote
0 answers
40 views

Multi Sampling in Rendering Pipeline?

I am trying to understand : How does multi-sampling rasterization effects pixel shader output? In a nutshell (i am skipping some steps to stay on point of question): Vertex data is fetched. Vertex ...
user2259784's user avatar
1 vote
2 answers
804 views

What is the most efficient way to render water?

Would I create the water surface mesh in C++, and control the movement/animation in the CPU, and afterward apply any shaders (reflect/refraction/caustics/etc..). Or should I only create the mesh in C++...
Biointrested's user avatar
1 vote
1 answer
1k views

How do I make an object not appear grey regardless of distance? [closed]

My moon texture is on a plane 500m away and I would like to know if there is a way to keep displaying the texture: As opposed to it turning grey as pictured here: regardless of the distance it is ...
qazwerty104's user avatar
0 votes
1 answer
472 views

Unity Geometryshader for one Vertex

Hy, I want to build some geometry with a geometryshader in Unity. I took a look at this. I want to create my geometry just in context of one point in 3D space (x,y,z). Can i somehow use the transform ...
Freshchris's user avatar
3 votes
0 answers
506 views

Subsurface Scattering - Transmittance

I have a question related to SSS and especially transmittance. I've looked at several papers about that topic, most of them from Jorge Jimenez, which are very interesting and, I admit, a bit hard for ...
MaT's user avatar
  • 1,055
2 votes
1 answer
4k views

Render Queue Sorting, HOW?

Recently I'm trying to implement a render queue sorting system, i.e., ordering my renderable objects in an array in such a way that the overhead of OpenGL state changes are minumum. After some ...
D01phiN's user avatar
  • 23
0 votes
0 answers
200 views

Phong shading blows out things close to white [OpenGL]; is there a way around this?

I'm doing per-pixel lighting using the Phong shading model. In pseudo code this looks like: ...
NeomerArcana's user avatar
1 vote
2 answers
6k views

Unity how to change material properties at runtime

I'm working on a unity game where I want to change the color of a material from within a script. The material applies to a line renderer. I currently have the following script: ...
Thijser's user avatar
  • 955
4 votes
1 answer
821 views

Why does my Outlined Diffuse 3 shader seem "detached" at a distance?

I'm using the Outlined Diffuse 3 shader from Unity and I'm having a problem with it: the outline looks great when the camera is near the object, but at a distance, it looks detached. From nearby (...
Hefaistos's user avatar
0 votes
0 answers
964 views

OpenGL shading doesn't work with different projection and view matrices?

I found an online (public-domain) code to do marching cubes, and I am trying to adapt this code to work in my own project. The code uses GLUT and "older-style" OpenGL, whereas I am using GLM and GLEW/...
kevin james's user avatar
0 votes
2 answers
159 views

Should I shade models before or after importing them into Unity?

Is it better to shade a model inside the 3D modeling software or inside Unity? As an example, if I need to use a transparent model, should it be made transparent inside the modeling application or ...
Dinal24's user avatar
  • 101
0 votes
1 answer
862 views

What is wrong with my specular phong shading

I'm sorry if this should be placed on stackoverflow instead however seeing as this is graphics related I was hoping you guys could help me: I'm attempting to write a phong shader and currently working ...
Thijser's user avatar
  • 955
3 votes
1 answer
2k views

draw fog of war using shaders

I am making a RTS game, and I'd like some advice on how to best render fog of wars, given what I'm already doing. You can imagine this game as being a classic RTS like Age of Empires 2, where the fog ...
lezebulon's user avatar
  • 1,412
4 votes
1 answer
2k views

glsl shader to allow color change of skydome ogre3d

I'm still very new to all this but learning a lot. I'm putting together an application using Ogre3d as the rendering engine. So far I've got it running, with a simple scene, a day/night cycle system ...
Tim's user avatar
  • 679