Sonic and Sega Retro Message Board: What is the benefit of twiddling dreamcast textures? - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
Page 1 of 1
    Locked
    Locked Forum

What is the benefit of twiddling dreamcast textures? As in, how does twiddling work?

#1 User is offline Cooljerk 

Posted 11 August 2016 - 04:54 PM

  • NotEqual Tech, Inc - VR & Game Dev
  • Posts: 4198
  • Joined: 06-April 06
  • Gender:Male
  • Wiki edits:9
When doing Dreamcast development, twiddling your textures before using them really speeds up rendering performance. I know the algorithm to twiddle (and unwtiddle) textures, and I can see the performance increase myself, and many DC Dev resources recommend it, but I'm still lost as to precisely why there is a performance increase in the first place. What about twiddled textures makes them faster to render? Anybody care to weigh in?

#2 User is offline 360 

Posted 11 August 2016 - 04:59 PM

  • Light Vision Overdrive
  • Posts: 2112
  • Joined: 22-September 10
  • Gender:Male
  • Location:United Kingdom
  • Project:Sonic Neon
You have to preset the rasteriser driver to zero then jettison the flux capacitor in to overdrive and then overclock the modular blast processing core. :specialed:

#3 User is offline Cooljerk 

Posted 11 August 2016 - 05:58 PM

  • NotEqual Tech, Inc - VR & Game Dev
  • Posts: 4198
  • Joined: 06-April 06
  • Gender:Male
  • Wiki edits:9
Asked around on a different forum and got my answer (I honestly thought this place would get me an answer quickest, Sonic Retro be slipping).

The reason for the performance increase is because the Holly chipset for the dreamcast has 4-port 16-bit VRAM, each with it's own address and data bus. So a single clock can read 4x16-bit texels. Only requirement is the 4 texture texels need to be in different banks/ports. Twiddling ensures adjacent texels will always be in different vram banks. So you get a form of parallelization when rendering.

Thanks to MetalliC for the explanation, if he winds up posting here.

#4 User is offline MainMemory 

Posted 11 August 2016 - 07:12 PM

  • Every day's the same old thing... Same place, different day...
  • Posts: 4200
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
Does anyone even do Dreamcast here? I mean, I know about PVR textures, but only because of SADXPC, where the twiddling probably doesn't matter (or makes it slower).

#5 User is offline Cooljerk 

Posted 11 August 2016 - 07:48 PM

  • NotEqual Tech, Inc - VR & Game Dev
  • Posts: 4198
  • Joined: 06-April 06
  • Gender:Male
  • Wiki edits:9

View PostMainMemory, on 11 August 2016 - 07:12 PM, said:

Does anyone even do Dreamcast here? I mean, I know about PVR textures, but only because of SADXPC, where the twiddling probably doesn't matter (or makes it slower).


I'm working on a dreamcast game right now, actually.

#6 User is offline 360 

Posted 11 August 2016 - 09:04 PM

  • Light Vision Overdrive
  • Posts: 2112
  • Joined: 22-September 10
  • Gender:Male
  • Location:United Kingdom
  • Project:Sonic Neon

View PostCooljerk, on 11 August 2016 - 05:58 PM, said:

Asked around on a different forum and got my answer (I honestly thought this place would get me an answer quickest, Sonic Retro be slipping).


I responded faster than that forum! Did you remember to overclock the modular blast processing core? :specialed:

View PostCooljerk, on 11 August 2016 - 07:48 PM, said:

I'm working on a dreamcast game right now, actually.


Okay so being serious for a moment this sounds awesome! Do you have enough completed to create a thread? I'm definitely interested! I'd like to learn more - could you tell us more about it? I love the homebrew Dreamcast scene. Great to see it alive and kicking and on this very forum. Post more about your game! :)

#7 User is offline Cooljerk 

Posted 11 August 2016 - 10:49 PM

  • NotEqual Tech, Inc - VR & Game Dev
  • Posts: 4198
  • Joined: 06-April 06
  • Gender:Male
  • Wiki edits:9
Well, the dreamcast version is just a small port of a larger project that is cross platform and runs on PC and mobile as well. I'm maintaining 2 versions of my project - one using SDL 2.0 for modern platforms, and a Dreamcast PVR port. I'm not quite ready to show my project off to Retro, but when I started on the dreamcast port I took notes as I worked and am in the process of turning it into a DC Dev tutorial that walks you through the process of creating a small breakout clone, from creating the toolchain all the way to actually running the game on your Dreamcast. I did that as I worked to familiarize myself with KOS and PVR. I'll probably post that guide within the next month.

#8 User is offline winterhell 

Posted 12 August 2016 - 11:42 AM

  • Posts: 1150
  • Joined: 16-October 10
  • Gender:Male
Just so we are clear, does that mean that the Dreamcast has its VRam in 4 blocks that are connected in Raid 0 and basically you have to make sure adjacent pixels end up in a different block?

#9 User is offline Cooljerk 

Posted 12 August 2016 - 01:43 PM

  • NotEqual Tech, Inc - VR & Game Dev
  • Posts: 4198
  • Joined: 06-April 06
  • Gender:Male
  • Wiki edits:9

View Postwinterhell, on 12 August 2016 - 11:42 AM, said:

Just so we are clear, does that mean that the Dreamcast has its VRam in 4 blocks that are connected in Raid 0 and basically you have to make sure adjacent pixels end up in a different block?


No, the VRAM is one two contiguous blocks of 32x1Mb that can be read as 8 MB total, but the output buffer of the dreamcast is split into 4 tiles that are rendered. Twiddling arranges the texels so that, when the data is read linearly, the texels are ready to go to the appropriate location according the block. I.E. texel 1 goes to block 1, texel 2 goes to block 2, texel 3 goes to block 3, texel 4 goes to block 4, texel 5 goes to block 1, texel 6 goes to block 2, texel 7 goes to block 3, etc. infinitely until you reach the end of the buffer. You don't need to spend time arranging the texels in VRAM, because the twiddle shape (butted up 'N' patterns) is per-arranging them for you. Memory access on the Dreamcast is slow, to the point where directly editing VRAM is inadvisable.

This all assumes your texture is a power of 2 to begin with, which is a necessity to twiddle in the first place.
This post has been edited by Cooljerk: 12 August 2016 - 01:50 PM

#10 User is offline 360 

Posted 12 August 2016 - 01:58 PM

  • Light Vision Overdrive
  • Posts: 2112
  • Joined: 22-September 10
  • Gender:Male
  • Location:United Kingdom
  • Project:Sonic Neon

View PostCooljerk, on 11 August 2016 - 10:49 PM, said:

Well, the dreamcast version is just a small port of a larger project that is cross platform and runs on PC and mobile as well. I'm maintaining 2 versions of my project - one using SDL 2.0 for modern platforms, and a Dreamcast PVR port. I'm not quite ready to show my project off to Retro, but when I started on the dreamcast port I took notes as I worked and am in the process of turning it into a DC Dev tutorial that walks you through the process of creating a small breakout clone, from creating the toolchain all the way to actually running the game on your Dreamcast. I did that as I worked to familiarize myself with KOS and PVR. I'll probably post that guide within the next month.


Sounds promising! I'd love to see more one day. Please do post about it when you have enough completed to show it off. I'm definitely interested!

Page 1 of 1
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users