Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411511 Posts in 69375 Topics- by 58430 Members - Latest Member: Jesse Webb

April 26, 2024, 02:35:08 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)The grumpy old programmer room
Pages: 1 ... 278 279 [280] 281 282 ... 295
Print
Author Topic: The grumpy old programmer room  (Read 738815 times)
ferreiradaselva
Level 3
***



View Profile
« Reply #5580 on: December 23, 2017, 05:59:59 AM »

I think there's the Objective-C runtime API, that you can call the objective-c stuff from C/C++. Never used, but I eventually will.
Logged

ferreiradaselva
Level 3
***



View Profile
« Reply #5581 on: December 23, 2017, 09:03:24 AM »

The worst bugs are the most obvious ones.

I made a big update on my framework 3-4 days ago. It was a big update, but everything should go smoothly. Then, nothing shows one the screen. It could be a million things (wrong vertex attrib configuration, wrong shader creation, wrong texture creation). 2 days searching for the problem.

The cause of the problem? Y coordinates of texture is inverted in PNG and I forgot that, so the quads were drawing a transparent region of my texture.
Logged

JWki
Level 4
****


View Profile
« Reply #5582 on: December 24, 2017, 12:58:40 AM »

I think there's the Objective-C runtime API, that you can call the objective-c stuff from C/C++. Never used, but I eventually will.

Yep it's all objective c.
Logged
Maximillian
Level 0
**


View Profile
« Reply #5583 on: December 24, 2017, 01:39:56 AM »

Like this one https://github.com/ssloy/tinyrenderer, but unrelated with GPU, only using software rendering.

Thanks for the link. That's a great lesson.
Logged
ferreiradaselva
Level 3
***



View Profile
« Reply #5584 on: December 24, 2017, 07:35:48 AM »

I think there's the Objective-C runtime API, that you can call the objective-c stuff from C/C++. Never used, but I eventually will.

Yep it's all objective c.


This is what I mean: https://stackoverflow.com/a/5901766
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #5585 on: January 27, 2018, 05:21:58 AM »

I spend more than 3 days on a trivial problem because of some legacy code, messing with the result, that were trying to solve a problem I no longer had ...

°kill me°                                                   Hand Shake Left WTF Hand Shake Right
Logged

ThemsAllTook
Administrator
Level 10
******



View Profile WWW
« Reply #5586 on: February 03, 2018, 08:06:31 PM »

This is more of a whew-I-solved-it post than a grumpy post, but I think it fits better here than in the happy room...

I had just set up a system that would allow my Blender exporter script to merge a model's bump and normal maps into a single combined normal texture. Great! But then I started noticing that my normal maps weren't quite rendering right... Some features that were supposed to be indented were protruding, and vice versa. It looked like it wouldn't be as simple as inverting the entire thing, since some sections were right but others weren't.

I tore apart my shader, normal map generator, and other parts of my code trying to understand what was going on. Eventually I tried reimporting the combined normal map into Blender, and it showed the same behavior as my own renderer. I determined that the problem areas had something to do with the orientation of the UV map in that spot; if I'd rotate the UV coordinates, it would make it worse or better. For a little while, I thought I just fundamentally didn't understand how normal mapping worked, and I'd have to somehow orient my map texture based on the UV coordinates that referenced it. Scary!

Also, Blender is really picky about baking normal maps. I had to do a bunch of troubleshooting and learn a weird dance that's sometimes necessary to get it to actually bake what I requested.

Finally, when I got Blender to behave and bake me a clean test normal map that I could compare against what I had generated, I was able to spot the problem - the helper utility I'd written that my exporter script uses to merge the normal and bump maps was referencing the images upside down. Blender and my renderer expected a y-up coordinate system, but I was just doing basic image manipulation, which is typically y-down. I flipped my bump-to-normal calculation on the y axis, and everything was fixed. Phew! Crisis averted. I wish I'd been able to figure that out without having to tear apart my entire system to find the problem.
Logged

Ordnas
Level 10
*****



View Profile WWW
« Reply #5587 on: February 05, 2018, 01:58:04 AM »

Recently I noticed that it is so common this kind of problems caused by different coordinate systems / orientation.  Sad
Logged

Games:

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #5588 on: February 07, 2018, 12:52:00 PM »



 Angry Angry
Logged

ProgramGamer
Administrator
Level 10
******


aka Mireille


View Profile
« Reply #5589 on: February 07, 2018, 01:12:19 PM »

Hey, at least everyone agrees on counter-clockwise triangles Tongue
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #5590 on: February 07, 2018, 04:14:42 PM »

I still hate programming, what I hate is prototyping and having to constantly refactor and renaming as you realize your real need, and the need to keep track of all dependency, and even though it's a prototype, you still need to pay attention to technical debt to not be stopped right in your thinking, damn busy works!, it's literally building the car while driving it
Logged

ProgramGamer
Administrator
Level 10
******


aka Mireille


View Profile
« Reply #5591 on: February 07, 2018, 05:13:55 PM »

I mean, refactoring is kinda par for the course if you're gonna make anything non-trivial. It's kind of the nature of programming. As you come up with your program, your understanding of the problem you're trying to solve evolves. That's what makes it enjoyable imho.
Logged

Ordnas
Level 10
*****



View Profile WWW
« Reply #5592 on: February 08, 2018, 12:52:39 AM »

For me what I enjoy in programming is something like "to create things on screen and make it moving". For example a refactor is something I do not enjoy, because I could spend that time implementing a new feature instead.  Roll Eyes
Logged

Games:

ProgramGamer
Administrator
Level 10
******


aka Mireille


View Profile
« Reply #5593 on: February 08, 2018, 07:40:50 AM »

Fair, and the joy of making stuff happens is also something that I deeply enjoy, but then I'm also a nerd who just enjoys the semantics of how programming languages work, so refactoring is this weird calm thing that I strangely still like doing. I guess I'd compare it to how some people enjoy grinding in RPGs.
Logged

Crimsontide
Level 5
*****


View Profile
« Reply #5594 on: February 08, 2018, 11:59:24 AM »

Fair, and the joy of making stuff happens is also something that I deeply enjoy, but then I'm also a nerd who just enjoys the semantics of how programming languages work, so refactoring is this weird calm thing that I strangely still like doing. I guess I'd compare it to how some people enjoy grinding in RPGs.

Ya I like refactoring as well.  I find it relaxing, sort of like putting a final coat of paint.  Once its working I can 'prettify' and optimize it and I really enjoy that part.
Logged
Maximillian
Level 0
**


View Profile
« Reply #5595 on: February 09, 2018, 04:00:46 AM »

I frequently lose interest in programming. It's not really something I enjoy to its fullest. I am more attracted to things more abstract. A.I. might be the only thing that keeps my interest for a little bit longer but even then I only enjoy it because it involves studying what intelligence is.
Logged
gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #5596 on: February 09, 2018, 08:01:52 PM »

My planet code is almost complete for the fundamentals, yet it send a last "fuck you" bug to make me rage all days and night, I have been staring the screen blank so much my eyes are actually bleeding red ... the logic should work WTF
Logged

gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #5597 on: March 09, 2018, 06:00:48 AM »


It's a simple raycaster, but the raycast is highly inconsistent   Outraged Outraged I have no idea why the code looks mighty fine to me  Blink
« Last Edit: March 09, 2018, 06:14:05 AM by gimymblert » Logged

qMopey
Level 6
*


View Profile WWW
« Reply #5598 on: March 09, 2018, 10:48:20 AM »

I have no idea what I'm looking at, but I do like it.  Hand Thumbs Up Left
Logged
gimymblert
Level 10
*****


The archivest master, leader of all documents


View Profile
« Reply #5599 on: March 09, 2018, 11:29:32 PM »

Following this tut: http://lodev.org/cgtutor/raycasting.html#Introduction
Left part is a top down view, right is first person, oval blob is wall hit to sample.
But the delta for ray interpolation is in the form of 1/x, it means that it oversample the middle and undersample the side, and the weird ray that is on the side and do not sample the correct wall color is the singularity.
Logged

Pages: 1 ... 278 279 [280] 281 282 ... 295
Print
Jump to:  

Theme orange-lt created by panic