lighting

D3D11: variable number of lights in HLSL

戏子无情 提交于 2021-02-07 08:17:22
问题 I'm working on a game engine in C++ and Direct3D11 and I want now to add a variable number lights to the scene. Up to date, I managed to add and render simple lights of a count that was already known and coded in the shader programs. In shader.fx: static const int LightsCount= 4; struct NF3D_LIGHT { // Members... }; cbuffer Light : register(b5) { NF3D_LIGHT light[LightsCount]; }; ... // And the pixel shader function: float4 PS(PS_INPUT input) : SV_Target { for(int i = 0; i < LightsCount; i++)

D3D11: variable number of lights in HLSL

你离开我真会死。 提交于 2021-02-07 08:16:35
问题 I'm working on a game engine in C++ and Direct3D11 and I want now to add a variable number lights to the scene. Up to date, I managed to add and render simple lights of a count that was already known and coded in the shader programs. In shader.fx: static const int LightsCount= 4; struct NF3D_LIGHT { // Members... }; cbuffer Light : register(b5) { NF3D_LIGHT light[LightsCount]; }; ... // And the pixel shader function: float4 PS(PS_INPUT input) : SV_Target { for(int i = 0; i < LightsCount; i++)

Showing Depth in Three.js Point Cloud

那年仲夏 提交于 2020-06-23 12:14:03
问题 I have a 3D scan of a rock that I have represented as a point cloud using Three.js, and I wanted to more explicitly show the features of the rock, perhaps using lighting to show depths with Three. Viewing the rock from the top, I see this: When looking closely from the side, you can see rigid features that I would like to show more closely: I am unsure in how to approach this, and was hoping for some help in showing these rock features within this visualization. For context, this is my

Showing Depth in Three.js Point Cloud

大憨熊 提交于 2020-06-23 12:12:54
问题 I have a 3D scan of a rock that I have represented as a point cloud using Three.js, and I wanted to more explicitly show the features of the rock, perhaps using lighting to show depths with Three. Viewing the rock from the top, I see this: When looking closely from the side, you can see rigid features that I would like to show more closely: I am unsure in how to approach this, and was hoping for some help in showing these rock features within this visualization. For context, this is my

Showing Point Cloud Structure using Lighting in Three.js

喜夏-厌秋 提交于 2020-04-14 08:33:27
问题 I am generating a point cloud representing a rock using Three.js, but am facing a problem with visualizing its structure clearly. In the second screenshot below I would like to be able to denote the topography of the rock, like the corner (shown better in the third screenshot) of the structure, in a more explicit way, as I want to be able to maneuver around the rock and select different points. I have rocks that are more sparse (harder to see structure as points very far away) and more dense

Ball of Light (Light, Material?) glutsolidsphere

别说谁变了你拦得住时间么 提交于 2020-01-14 06:47:12
问题 I'm programming a game which is called Falldown. I'm almost finished; now I want to design the ball. How can I light this ball such that it glows like these examples? I created my cube with glutSolidSphere and ask myself how I can light the ball. void ball() { glColor4f(0, 0, 0.5, 0.5); glutSolidSphere(0.25,40,40); } void initLightSources() { ?????? glEnable( GL_LIGHTING ); glEnable(GL_DEPTH_TEST); glEnable( GL_LIGHT0 ); } 来源: https://stackoverflow.com/questions/23938836/ball-of-light-light

Techniques to smooth face edges in OpenGL

冷暖自知 提交于 2020-01-13 06:24:08
问题 When I light my human model in OpenGL using face normals it is very apparent where each face is on the model. The lighting becomes considerably smoother using vertex normals but still noticeable. Is there any technique available to smooth organic models without adding additional vertices (ex. subdivisions)? 回答1: If you are seeing single faces with per vertex normals you might have forgotten to enable smooth facing: glShadeModel(GL_SMOOTH); If that's not helping make sure all vertices with the

OpenGL: Blinn-Phong model implemented in shaders give wrong result

£可爱£侵袭症+ 提交于 2020-01-05 04:18:30
问题 First of all I'm new with computer graphics, openGL and have a basic knowledge of c++ coding. I have struggled with the openGL project like a month and have come to a point where I have to implement shading with Blinn-Phong model. I have implemented calculations in vertex and fragment shaders. There is/are propably some minor error(s) in code because without shading everything works perfectly but after shading parts are added to shaders anything does not happen. I calculate surface normals in

Libgdx and Box2DLights - too bright + colors grayed out

…衆ロ難τιáo~ 提交于 2020-01-05 03:05:35
问题 I'm writing a game with LibGDX and Box2DLights for lighting. The first problem is when my lights overlap each other. I have directional light on sun and point light on character. When they overlap output color is way too bright. I tried changing colors of lights but lowering these makes lights useless when there's only one light(too dark). My second problem is the colors are a bit grayed out(see on screen). Image showing my problems - first screen is too bright, second is with only one light

Fast 2D illumination algorithm?

…衆ロ難τιáo~ 提交于 2020-01-02 04:42:10
问题 We have a rectangular area with translucent walls and a few light sources.We are considering only the top view,so it is a 2D problem. We need to find the approximate lighting (signal strength)at each point of the area. We need to make the algorithm really fast. The brute force method was just too slow for our purposes. You can assume that all walls attenuate by same amount, even constant amount of attenuation is acceptable. The area would be at most 1000x1000, and there would not be more than