New answers tagged

0

Expanding on the previous answer what you need is a concept of global coordinates. Every cell in the world has a globally unique coordinate which is used to generate that cell's random value. The cells themselves are stored in chunks in chunk local coordinates though, so you need a way to address each cell by chunk and offset. The spatially coherent ...


2

It looks an introduction to linear algebra is in order, or more precisely the dot product: dot(a, b) = |a| |b| cos(Theta) Why is it helpful? Because of its relation to the scalar/vector projection, the length of projection of vector a onto vector b is lenPA = |a| cos(theta) or more practically, derived from dot product definition: lenPA = (a . b) / |...


1

is this what you want ? float endPercent = curLength / totalLength; // Calculates the percent of colour at the ending point of the line to be used in current pixel float startPercent = 1 - (curLength / totalLength); // Calculates the percent of ...


3

Linear interpolation is the simplest way to interpolate. Here's the function for it: private double linearInterpolate3d(double xm_ym_zm, double xp_ym_zm, double xm_yp_zm, double xp_yp_zm, double xm_ym_zp, double xp_ym_zp, double xm_yp_zp, double xp_yp_zp, double x, double y, double z) { ...


-1

Most of the stuff in GPU Gems is shader stuff. The code you are trying to replicate in C# is ShaderLab, which Unity also uses for shaders. In other words, the lines of code would be the same and would be part of a custom shader that you would apply.


3

This question will probably be closed, but I want to provide you with some pointers anyway: I have done an OpenGL implementation of that article in question, back when the geometry stage was new. It was quite heavy to do, and then I was not constrained by an existing enginge but did my implementation from scratch. The article contains everything you need ...



Top 50 recent answers are included