New answers tagged

0

Last week, I moved the code about determining color from the vertex fragment to the fragment shader, it worked. That is to say, Fragment Shader varying vec3 v_pos; void main( void ) { gl_FragColor = vec4(vec3(step(v_pos.x, 0.), 0., step(0., v_pos.x)), 1.); } Vertex Shader varying vec3 v_pos; void main() { v_pos = position; vec4 mvPosition =...


1

I've never implemented any of this stuff before. But from my understanding there's two basic ways you could solve this problem. Decals The simplest solution would be to just to just put simple billboards with "wet" or "clean" materials on top of the surfaces. This has the real world equivalent of placing an animatable sticker on top of ...


0

Add the line thread.start() to void start() else the thread doesn't start


2

In start you do running = false; which means that when run gets called, the gameloop will never activate and hence your actual rendering code will never run. In the linked video the code in start sets running to true.


3

It depends on how much you want framing the shot to count Basically, there are two ways you can look at this problem. You can either treat the player as someone trying to exactly recreate the scene from the photo, or you can treat it more like a scavenger hunt where the photo is just a "thing" you need to find. If you want the player to have to ...


10

To handle a symmetrical object like a cube that could be photographed from many different directions, you could try comparing silhouettes: Render the quest object's silhouette and match that against the current camera view. Create the quest Use a render texture, set your camera to clear with transparent and to only renders that one object, render. Convert ...


5

I would say it depends a lot if you have one spot for every "photo" or if there are several possible place where the photo could be used. If you got one spot for every photo, you can simply check for the coordinates and the players viewing direction. Than you can add some tolerance to both and that should be enough. But if you got several places ...


3

This might look different depending on the tools you are using, but here is how I would approach this. Getting the Texture In the scene where the place of the photo exists, create a camera object, that is only available to you (and other developers), but not the end user. When needed, take a screenshot of what that camera sees, and use that as a 2D texture. ...


1

For shapes like this, I tend to use a series of box colliders. It may be easier to make a child box object that you can rotate and scale in to position, and then disable the rendering on these objects once you are happy with their placement. You'll want to trace the outline with these boxes. The less boxes you can use the better. Look at the faces along the ...


Top 50 recent answers are included