Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411490 Posts in 69371 Topics- by 58428 Members - Latest Member: shelton786

April 24, 2024, 05:33:25 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)What are you programming RIGHT NOW?
Pages: 1 ... 65 66 [67] 68 69 ... 71
Print
Author Topic: What are you programming RIGHT NOW?  (Read 210083 times)
InfiniteStateMachine
Level 10
*****



View Profile
« Reply #1320 on: October 11, 2016, 09:11:08 AM »

You are correct. I've since fixed the text...... I think  Who, Me?
Logged

TomHunt
Level 3
***



View Profile WWW
« Reply #1321 on: October 11, 2016, 10:32:06 AM »

generic item usage mechanic / subsystem ; so a 'gun' behaviour would have a less-hardwired interface for input controllers to use it from, that could also be applied to things that are not guns
Logged

~tom | □³ | kRYSTLR
ndnninja15
Level 1
*


I make games


View Profile
« Reply #1322 on: November 30, 2016, 09:30:04 AM »

Making my camera interpolate in between game updates, since the time step is fixed well below 60FPS, in order to make the scrolling smoother.
Logged
Samaras-Sama
Level 1
*


samy is my hero


View Profile
« Reply #1323 on: November 30, 2016, 01:07:49 PM »

Rendering simple 3D shapes the hard way; in Javascript and only using 2D canvas functions.



It works like this, you break a graphic into little rows called scanlines, and then draw each scanline when you've scaled it by a certain amount, translated it, and centered it. The whole thing is done quickly with matrix multiplication.

This optical trick works for drawing planes and boxes.
« Last Edit: November 30, 2016, 01:30:43 PM by 24-bit » Logged

Devlog<br /><br />[/
Sik
Level 10
*****


View Profile WWW
« Reply #1324 on: November 30, 2016, 05:40:17 PM »

The trick I've heard involved having each triangle as its own quad (i.e. half of it filled, half empty) then use matrix transforms to position the vertices. This is one draw for every polygon, as opposed to every line. The downside is that you're stuck with affine mapping with the same kind of artifacts as the PS1, and near plane clipping is hell. It was a nice alternative before WebGL though, although nobody really bothered to do 3D seriously on 2D canvas anyway.

Your method reminds me of some blitter trickery on some Amiga demos Tongue
Logged
Samaras-Sama
Level 1
*


samy is my hero


View Profile
« Reply #1325 on: November 30, 2016, 09:18:31 PM »

It was a nice alternative before WebGL though, although nobody really bothered to do 3D seriously on 2D canvas anyway.

Your method reminds me of some blitter trickery on some Amiga demos Tongue

this is the exact reason for doing it this way.

Amiga demoscene had some of the coolest visuals. It was a shame I wasn't around during that era. Way back when in 2009, when the HTML5 canvas was still newish and WebGL wasn't as popular, an Opera Browser dev and Nintendo hacker on the forums named Hullbreach had written a full 3D engine for the Nintendo DSi Opera browser app using an approach similar to this at http://dsipaint.com. I think his example is still there on his site as the DSi Opera SDK. http://dsipaint.com/sdk/menu_sdk.php

The above effect is nicknamed Mode7, but what I'm showing you in the screenshot, I'm not the author of. I'm still trying to figure out how the wall textures are being drawn. https://en.wikipedia.org/wiki/Mode_7 There are many ways to imitate 3D using 2D and no de-facto standard for doing this, with some ranging from displaying quads as voxels and resizing them and re-positioning as you go along.

This is a much of just a generalization of MODE7 where you don't transform scanlines but instead transform each pixel, triangle, or quad of your intended 3D object using scaling, rotating, etc. I see what you're getting at. There was a 90's flight simulator that did it this way and hackers for SNES, Genesis, and GBA systems have used this to create perspective.
« Last Edit: November 30, 2016, 11:07:21 PM by 24-bit Color » Logged

Devlog<br /><br />[/
Sik
Level 10
*****


View Profile WWW
« Reply #1326 on: November 30, 2016, 10:26:51 PM »

Wait, I thought you were talking about the walls before. Some Amiga demos would render a bunch of textured lines with the blitter to get textured polygons (though the overhead killed the performance). This is also how the Saturn hardware renders distorted quads (which also happens to introduce a particularly annoying bug with translucent quads as some pixels would get drawn twice). In fact the particular texture distortion in that GIF looks pretty much like the what the Saturn does.

But yeah, for arbitrary 3D shapes the method I mentioned earlier may be better. There's the near clipping issue, but seeing as you'd have to split things into smaller polygons just to compensate for the distortion (no, seriously, it gets pretty bad) means you may be able to get away with just removing the entire polygons instead of clipping altogether.
Logged
readyplaygames
Level 2
**


View Profile WWW
« Reply #1327 on: December 01, 2016, 11:57:05 AM »

I am fighting Android/iOS problems! They're the best! Like, how you can make something work on one machine, but it doesn't work on another without any explanation. Hooray!
Logged
ndnninja15
Level 1
*


I make games


View Profile
« Reply #1328 on: December 01, 2016, 01:06:28 PM »

Programming some AI for these little goblin guys. Right now I just stationary printed them to the screen to test out drawing.

Logged
tpelham42
Level 0
**


Mercury Fallen


View Profile WWW
« Reply #1329 on: December 13, 2016, 04:54:23 PM »

Coding some procedural cave/ore generation using layered cellular automata.

Logged

Current Project: http://www.mercuryfallen.com
Find me on twitter: @tpelham42
Krux
Level 2
**



View Profile
« Reply #1330 on: December 13, 2016, 06:56:45 PM »

Currently I am doing meta programming to generate all the boilerplate code for OpenGL, so that in the end you only need to write code that matters  Gentleman. So since I am doing metaprogramming the metaphorical screenshot is how readable the hello triangle in OpenGL core profile becomes with shader code included:

Code:
import fancygl

let (window, context) = defaultSetup()

let vertices = arrayBuffer([vec4f(-1,-1,0,1), vec4f(1,-1,0,1), vec4f(0,1,0,1)])
let colors   = arrayBuffer([vec4f( 1, 0,0,1), vec4f(0, 1,0,1), vec4f(0,0,1,1)])

var evt: Event = defaultEvent
var runGame: bool = true

while runGame:
  while pollEvent(evt):
    if evt.kind == QuitEvent:
      runGame = false
      break
    if evt.kind == KeyDown and evt.key.keysym.scancode == SDL_SCANCODE_ESCAPE:
      runGame = false

  shadingDsl:
    primitiveMode = GL_TRIANGLES
    numVertices = 3
    attributes:
      a_vertex = vertices
      a_color  = colors
    vertexMain:
      """
      gl_Position = a_vertex;
      v_color = a_color;
      """
    vertexOut:
      "out vec4 v_color"
    fragmentMain:
      """
      color = v_color;
      """

  glSwapWindow(window)

Logged
_glitch
Guest
« Reply #1331 on: December 15, 2016, 01:21:36 PM »

I am currently programming all the different screens, buttons and GUIs for my game. I hope I will get this boring stuff done today that I can work on the enemy AI tomorrow.
Logged
_glitch
Guest
« Reply #1332 on: December 16, 2016, 11:44:34 AM »

No enemy AI today, but I will try to add collisions to my tilemap.
Logged
DrDog
Level 0
**


View Profile
« Reply #1333 on: December 17, 2016, 08:39:29 PM »

Rendering simple 3D shapes the hard way; in Javascript and only using 2D canvas functions.



It works like this, you break a graphic into little rows called scanlines, and then draw each scanline when you've scaled it by a certain amount, translated it, and centered it. The whole thing is done quickly with matrix multiplication.

This optical trick works for drawing planes and boxes.

So you are writing a soft-renderer? That's rad, I only ever got as far as a rayrtracer which is even less practical.
Logged
Krux
Level 2
**



View Profile
« Reply #1334 on: December 18, 2016, 03:33:03 AM »

@DrDog If you write your raytracer in the fragment shader of glsl (or pixel shader of direct 3D) then it is very much practical to write a raytracer. You only need to render a fullscreen quad all the time and then put all the logic in the fragment shader, and there the programming is surprisingly pleasant to do.
Logged
_glitch
Guest
« Reply #1335 on: December 19, 2016, 01:54:54 PM »

Now I'm creating all the stuff necessary for sprite effects, drawing projectiles like arrows or fire or I don't know. All the stuff you would expect in a RPG.

Man, I should really start a DevLog...
Logged
MichaelTodd
Level 0
*


MT


View Profile WWW
« Reply #1336 on: December 22, 2016, 06:55:49 AM »

I'm coding a conveyor belt system, sort of like Factorio. I've rewritten the whole bloody system, like 4 times. Determined to make it clean! Zero mess, everything reserves every tile that it needs to, so there is never overlap. This does lead to some weird gaps, but oh well.  Facepalm

Logged
Sik
Level 10
*****


View Profile WWW
« Reply #1337 on: December 23, 2016, 06:41:25 PM »

@DrDog If you write your raytracer in the fragment shader of glsl (or pixel shader of direct 3D) then it is very much practical to write a raytracer. You only need to render a fullscreen quad all the time and then put all the logic in the fragment shader, and there the programming is surprisingly pleasant to do.
The problem is performance with arbitrary 3D scenes. I definitely think that compute units in modern GPUs now may be able to be up to the task, but it's not even remotely trivial, especially trying to keep it as parallel as possible (which means reducing diverged branching as much as you can). As usual, the problem is the raytracing step itself. If you can pull it off though, you may not want to go back to a normal rasterizer even again. Translucency, lighting with many lights, their shadows, reflections (including for curved surfaces!) all of them suddenly become trivial to do.

Although maybe for the performance issue we should try to attack the problem from a different viewpoint. Instead of trying to raytrace hi-poly meshes maybe we should do lo-poly meshes and try adding detail in some other way? (maybe figure out how to modify parallax textures so the ray can go outwards and render nothing when it escapes? then you can do very lo-poly meshes and add curves and tiny details and such through the heightmap texture)
Logged
oahda
Level 10
*****



View Profile
« Reply #1338 on: December 27, 2016, 01:56:56 PM »

Decided to play around and do my first ever properly fully 3D stuff in OpenGL from scratch.
Only done 2D or 2.5D this way before, and full 3D stuff only in Unity, so wooh! Coffee Evolving!

Logged

Smerik
Level 1
*



View Profile
« Reply #1339 on: December 28, 2016, 01:23:26 AM »

Was working on a voxel physics engine for a long time, might go back to it some day when i come up with a better way to optimize it,

https://forums.tigsource.com/index.php?topic=54445.0
Logged

Pages: 1 ... 65 66 [67] 68 69 ... 71
Print
Jump to:  

Theme orange-lt created by panic